[Zope-dev] SVN: zope.tal/trunk/src/zope/tal/dummyengine.py assert isn't a function, using parens will cause the two arguments to be treated as a 2-tuple, hence always true.

Benji York benji at zope.com
Mon Dec 8 13:40:57 EST 2008


On Mon, Dec 8, 2008 at 12:26 PM, Tres Seaver <tseaver at palladion.com> wrote:
> A better fix would be to strip outthe 'assert' keyword everywhere, and
> use 'self.failUnless' / 'self.failIf' instead:  that would allow getting
> rid of the "backsplash", as well.

Yep.  Another reason not to use "assert" in tests is that if the tests
are run with Python's -O or -OO switches, the asserts will be optimized
away.
-- 
Benji York
Senior Software Engineer
Zope Corporation


More information about the Zope-Dev mailing list