unittest vs py.test?

Paul Rubin http
Sun Apr 3 19:58:59 EDT 2005


"Terry Reedy" <tjreedy at udel.edu> writes:
> > But assert statements vanish when you turn on the optimizer.  If
> > you're going to run your application with the optimizer turned on, I
> > certainly hope you run your regression tests with the optimizer on.
> 
> I don't see why you think so.  Assertion statements in the test code make 
> it harder, not easier for the test to pass.  Ditto, I believe, for any in 
> the run code, if indeed there are any.

If the unit tests are expressed as assert statements, and the assert
statements get optimized away, then running the unit tests on the
optimized code can obviously never find any test failures.



More information about the Python-list mailing list