checking assertions in a lambda in python
<p>I'm trying to use assertions to show some invariants (mostly in testing)
Thus i want to write something like the following: </p>

<pre><code>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))
</code></pre>

<p>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?</p>
