def test_function_exception2(self): y = foo.my_inverse_func2(2) self.assertEqual(y, 0.5) self.assertRaises(foo.exception, foo.my_inverse_func2, 0) try: foo.my_inverse_func2(0) except foo.exception, ex: msg = str(ex)