[tahoe-dev] [tahoe-lafs] #749: Tahoe-LAFS fails unit tests when the "-OO" flag is passed to Python to optimize and strip docstrings

tahoe-lafs trac at allmydata.org
Wed Jul 15 09:49:31 PDT 2009


#749: Tahoe-LAFS fails unit tests when the "-OO" flag is passed to Python to
optimize and strip docstrings
------------------------+---------------------------------------------------
     Reporter:  zooko   |       Owner:  somebody
         Type:  defect  |      Status:  closed  
     Priority:  major   |   Milestone:  1.5.0   
    Component:  code    |     Version:  1.4.1   
   Resolution:  fixed   |    Keywords:          
Launchpad_bug:          |  
------------------------+---------------------------------------------------

Comment(by swillden):

 I'm no expert on unit testing, but I think it makes sense that assertions
 (preconditions, postconditions, etc.) are things that don't need to be
 tested.  I see them not as code which must be validated for correctness,
 but instead as code that does correctness validation, like the unit tests.

 Said another way, assertions and other design-by-contract artifacts are
 actually tests.  They're just tests that are normally run all the time
 rather than only when we choose to explicitly invoke a test run.

 If you need to write test code to test your assertions, don't you also
 need to write test code to test your unit tests?  And test code to test
 the test code that tests your tests, and... (try saying that five times
 fast) :-)

-- 
Ticket URL: <http://allmydata.org/trac/tahoe/ticket/749#comment:3>
tahoe-lafs <http://allmydata.org>
secure decentralized file storage grid


More information about the tahoe-dev mailing list