[TIP] Ideology

Doug Hellmann doug.hellmann at gmail.com
Fri Apr 24 13:13:51 PDT 2009

On Apr 24, 2009, at 3:47 PM, Douglas Philips wrote:

> On or about 2009 Apr 24, at 3:29 PM, Doug Hellmann indited:
>> The SkipTest exception is an interesting solution.  It seems like it
>> would work well for tests where fixtures aren't expensive, but I've
>> found that explicitly tagging tests to be run or not works better
>> for me.  The tag can be applied conditionally via a decorator when
>> the test is imported, so you still get the dynamic behavior based on
>> available resources.
> Maybe this doesn't apply to most unit testing environments, but in the
> environment I'm in, we don't usually know at module/class load/
> interpretation time whether or not a particular test method is going
> to be skipped or not. Sometimes we know once everything is loaded and
> the device under test is interrogated, but in many of our test
> methods, the test method itself has to do very specific/detailed
> interrogation (of both the device and the configuration enviroment)
> and then decide at the time it is run if it should skip. I can see how
> it would be useful to have a load-time skip-ability though we haven't
> needed it. (We treat failure to load a test module as a failure of the
> code review process :) ).

Yeah, it sounds like we have different use cases.  Usually the tests I  
want to skip require some specialized piece of hardware (like a  
particular brand of network switch or storage array).  The entire test  
module is tagged to be skipped by the automated run by default, and we  
only enable the tests when the equipment is available.


More information about the testing-in-python mailing list