Formatting and using assertRaises instead