Paul Rubin wrote:
"Terry Reedy" <[EMAIL PROTECTED]> 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.

Any code depending upon __debug__ being 0 won't be tested. Sometimes test structures update values as a side-effect of tracking the debugging state. Not massively likely, but it makes for a scary environment when your tests cannot be run on a non-debug version.

--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to