I'm trying to use assertions to show some invariants (mostly in testing) Thus i want to write something like the following:
values = [ range(10) ]
expected_values = [ range(10) ]
map (lambda x: assert x[0] == x[1] ,zip( [ run_function(i) for i in values ], expected_values))
If I use this with unittest.assertEqual this works perfectly fine , but if I want to write this with an assertion it just fails. Is there a way to fix this?