[TIP] A nose plugin to randomize the order of unittest.TestCase tests

Charles McCreary charles.mccreary at crmeng.com
Sat Apr 25 10:17:43 PDT 2009


I've written a plugin that randomizes the test order of tests built with the
unittest.TestCase framework. I've attached the plugin, a setup file for
installation, and a patch against nose Version: 0.11.0.dev-r635. The patch
is somewhat relase agnostic as it just adds files, including a test.

The usage is --randomize

The seed is printed at the start so that failures can be replicated in a
deterministic way with --randomize --seed=<whatever seed was printed>

It has already flushed out 19 errors in the functional test suite of one of
my projects. Not too bad, as there is a little over 1200 functional tests.

Also posted on http://code.google.com/p/python-nose/issues/detail?id=255

*Charles R. McCreary P.E.*
13774 Hwy 322
Kilgore, TX 75662
Voice: 903.643.3490
Fax: 866.804.1919
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.idyll.org/pipermail/testing-in-python/attachments/20090425/d370c721/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: randomize.py
Type: text/x-python
Size: 3794 bytes
Desc: not available
Url : http://lists.idyll.org/pipermail/testing-in-python/attachments/20090425/d370c721/attachment.py 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: setup_randomize.py
Type: text/x-python
Size: 582 bytes
Desc: not available
Url : http://lists.idyll.org/pipermail/testing-in-python/attachments/20090425/d370c721/attachment-0001.py 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: randomize.patch
Type: application/octet-stream
Size: 6613 bytes
Desc: not available
Url : http://lists.idyll.org/pipermail/testing-in-python/attachments/20090425/d370c721/attachment.obj 


More information about the testing-in-python mailing list