Skipping unit tests

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Thu May 14 04:29:47 EDT 2009


En Mon, 11 May 2009 10:33:03 -0300, Ulrich Eckhardt  
<eckhardt at satorlaser.com> escribió:

> We have a few tests for some module here. These tests are under  
> development
> and applied to older versions (with less features) of the module, too.  
> That
> means that if I have module version 42, tests A and B can not possibly
> work. I don't want to have test failures but I also don't want to fork  
> the
> test suite, so how do I get the tests to behave like Python's test suite,
> which also skips some "expected failures".

The simplest way would be to check for some condition (code version,  
attribute existence) in the tests themselves, and just skip it when it's  
not apropiate.

Another way is to omit the test case from the suite. Things can be a lot  
fancier... Look at the Python test suite for some ideas.

-- 
Gabriel Genellina




More information about the Python-list mailing list