[Web-SIG] [Python-Dev] FYI: wsgiref is now checked in

Phillip J. Eby pje at telecommunity.com
Mon Jun 12 06:00:01 CEST 2006


At 03:22 PM 6/10/2006 -0400, Tim Peters wrote:
>This may be because compare_generic_iter() uses `assert` statements,
>and those vanish under -O.  If so, a test shouldn't normally use
>`assert`.  On rare occasions it's appropriate, like test_struct's:
>
>             if x < 0:
>                 expected += 1L << self.bitsize
>                 assert expected > 0
>
>That isn't testing any of struct's functionality, it's documenting and
>verifying a fundamental _belief_ of the test author's:  the test
>itself is buggy if that assert ever triggers.  Or, IOW, it's being
>used for what an assert statement should be used for :-)

Thanks for the bug report; I've fixed these problems in the standalone 
version (0.1.2 on the cheeseshop) and in the Python 2.5 trunk.

Web-SIG folks take note: wsgiref.validate is based on paste.lint, so 
paste.lint has the same problem.  That is, errors won't be raised if the 
code is run with -O.

As a side effect of fixing the problems,  I found that some of the 
wsgiref.validate (aka paste.lint) asserts have improperly computed 
messages.  Instead of getting an explanation of the problem, you'll instead 
get a different error at the assert.  I fixed these in wsgiref.validate, 
but the underlying problems presumably still exist in paste.lint.



More information about the Web-SIG mailing list