[Zope-Coders] -O considered useful
Jeremy Hylton
jeremy@zope.com
Mon, 22 Oct 2001 21:33:15 -0400 (EDT)
This reminds me:
If you run with python -O, you execute slightly different code. The
compiler optimizes away all code inside if __debug__ and all code in
assert statements. As a result, many regression tests do nothing when
run with python -O.
We should fix our tests to use the assertXXX methods, like assertEqual
instead of using assert statements. Note that assertEqual also
produces a better default error message than assert x == y.
Jeremy