def test_squares_floats(self): """When passed a float, it should square it""" self.assertEqual(square(1.5), 2.25)
def test_string_fail(self): """Trying to square a string raises a TypeError""" with self.assertRaises(TypeError): square('string')
def test_squares_ints(self): """When passed an integer, it should square it""" self.assertEqual(square(2), 4)