skipping one unittest assertion?

Roy Smith roy at panix.com
Sun May 1 14:16:24 EDT 2011


In article <Xns9ED87276142BEOKB at 188.40.43.213>,
 "OKB (not okblacke)" <brenNOSPAMbarn at NObrenSPAMbarn.net> wrote:

> Roy Smith wrote:
> 
> > Is there any way to skip a single assertion in a unittest test
> > method?  I know I can @skip or @expectedFailure the method, but I'm
> > looking for something finer-grain than that.
> > 
> > There's one particular assertion in a test method which depends on 
> > production code that hasn't been written yet.  I could factor that
> > out into its own test methods and @skip that, but it would be
> > cleaner to be able to mark the particular assertion.
> > 
> > (using python 2.6, but importing unittest2 from 2.7)
> 
>     	Can't you just comment out that line?

Sure, but the point of @skip and @expectFailure is that they leave a 
visible trail in the test output that you need to go back and fix 
something.



More information about the Python-list mailing list