[TIP] Randomizing test order with nose

Douglas Philips dgou at mac.com
Thu Apr 23 20:22:20 PDT 2009


On 2009 Apr 23, at 11:30 AM, C. Titus Brown wrote:
> What about just setting the seed yourself, before each test, and then
> storing that?  You have the problem of generating a "new" seed, but  
> you
> could easily do that by using the time + # of test, or some such.

That is exactly what we've been doing.
Either the PRNG state is set from the command line, or it set from a  
time of day * 1000 value.
In either case the value set is logged so that we know what was used  
and can then reproduce the run with a command line switch that sets  
the value from the log. If we wanted to require the log itself to be  
present in order to reproduce a particular run, we could simply dump  
the large state value from the PRNG in a format trivial to scrape from  
the log, but so far we haven't wanted to/needed to do that.

-Doug




More information about the testing-in-python mailing list