[TIP] Randomizing test order with nose

Douglas Philips dgou at mac.com
Thu Apr 23 05:31:46 PDT 2009

On or about 2009 Apr 22, at 6:36 PM, Scott David Daniels indited:
> There, the simple expedient of subclassing Random by attaching a  
> counter to the root
> pseudo-random number generator meant that you could characterize your
> position in the random number sequence as (_seed, _calls).
> I think jumpahead is going away altogether in Python 3.X.

We didn't use jumpahead specifically, but in previous versions of our  
attempts to make the PRNG reproducible we used a counter (and manually  
called random() to catch up). It was very tricky to make sure everyone  
had pulled in the right version of the instrumented random. Had we  
planned for that up front we could have forced the bottleneck  
necessary. Instead we've found it was just must simpler to seed the  
PRNG to captured and known value, when needed.
Test reproducibility is crucial when debugging large systems. I'm not  
sure it is of much, if any, use for strict unit-test scope testing.


More information about the testing-in-python mailing list