unittest: Calling tests in liner number order

Diez B. Roggisch deets at nospam.web.de
Sun May 25 10:53:40 EDT 2008


> In fact, from a protocol point of view, some of the types really do depend 
> on each other.  We send counted strings, for example, so we can't send a 
> string until we know how to send an int (for the string length).  If the 
> first test that fails is the string test, I know right off that the problem 
> is not in how we send ints, because that test ran already and it passed.
> 
> Earlier, I gave another example of wanting tests to be run in the same 
> order as some externally controlled set of functional requirements.  Again, 
> not because the tests have inter-dependencies, but because it just makes it 
> easier to interpret the results.
> 
> Don't assume inter-test dependencies (which I agree are a Bad Thing) is the 
> only reason you want to run tests in a specific order.

Both these points can be solved by application of output ordering or 
even better using groups of tests inside individual modules that test 
e.g. basic functionality. Selecting these to run first before trying to 
run more complicated tests is much more senseful than just letting a 
single test run in a determined order.

Diez



More information about the Python-list mailing list