[TIP] Ideology

C. Titus Brown ctb at msu.edu
Fri Apr 24 11:40:24 PDT 2009

On Fri, Apr 24, 2009 at 02:29:26PM -0400, Douglas Philips wrote:
-> >In case people are interested, here are four alternatives I came up  
-> >with
-> >for conditionally defining tests:
-> >
-> >http://github.com/ctb/pygr/tree/runtest_single_x/trial/
-> >
-> >tests.py -- basic broken example
-> >
-> >tests-no-append.py -- what we do now, not compatible with some other
-> >	test selection code that we want to add
-> >
-> >tests-skip.py -- fails in unittest, but can yield informative message
-> >	to those not using nose/not having necessary resources
-> >
-> >tests-skip-by-nodef.py -- succeeds, not pretty
-> >
-> >test-skip-hack.py -- my proposed actual hack, which only requires
-> >	modifying the unittest test runner in a minor way.
-> I'm not sure what this has to do with conditionally defining tests, it  
-> seems to be about extending unittest to handle a new kind of result  
-> (Skip). Maybe I'm confused. When we added our extra test results  
-> mechanisms we started with a copy of unittest because it wasn't  
-> factored in a way that lets subclassing work cleanly for this kind of  
-> thing, and we knew that no one in Python core was interested in making  
-> a change to the old 2.4.x tree. (Hopefully we'll be moving up to 2.5,  
-> but we won't be close to the cutting edge anytime soon, such are the  
-> fortunes of corporate life).

We are after conditionally *executing* tests, I guess.  SkipTest is one
of several ways to do that; tests-no-append and tests-skip-by-nodef are
other ways (one of which is conditionally defining, one conditionally

C. Titus Brown, ctb at msu.edu

More information about the testing-in-python mailing list