def test_should_raise_exception(self): with self.assertRaises(TypeError): x = 4 increment.inc2(x, n="xyz")
def test_should_increment_by_n(self): n = 3 actual = increment.inc2(self.x, n=3) self.assertEqual(self.x + n, actual, "what!")
def test_should_catch_exception(self): increment.inc2(3, n="xyz")