Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_typed_fn(self):
# ensure no error is raised and function behaves as intended
assert add_ints(1, 2) == 3
# ensure invalid types cause TypeErrors to be raised
with self.assertRaises(InputTypeError):
add_ints(1.0, 2.0)
def test_list_type(self):
assert sum_list([1, 2]) == 3
with self.assertRaises(InputTypeError):
sum_list([1.0, 2.0])