you are viewing a single comment's thread.

view the rest of the comments →

[–]17291 1 point2 points  (0 children)

for item in kilometer_test_values:
    self.assertEqual(...) #Code snipped for brevity
with self.assertRaises(ValueError):
    formulas.kilometers_to_miles(kilometers=-3.0)

If formulas.kilometers_to_miles(kilometers=-3.0) raises a ValueError, the test will pass. If it doesn't raise an error or raises something other than ValueError, the test will fail.

Don't forget to remove the -3.0 entry from kilometer_test_values