[TIP] Nose: running django tests in parallel
Eyal Reuveni
eyal at eventbrite.com
Fri Oct 10 10:42:24 PDT 2014
Hi folks!
We've open sourced a nose plugin to run django tests in parallel.
We've been using it at Eventbrite now for more than 6 months quite
successfully (brought our unit tests time down 75%), and you should
use it too! It creates a new database per process (the
--futz-with-django option) which isolates your unit tests pretty well.
It runs all unit tests in a file in the same process, just in case you
somehow have them depending on each other.
Really only one gotcha if you'd like to use it yourself: don't put
tests in a tests/__init__.py file, as they'll be run in every process.
Otherwise, the standard parallel unit testing mantras apply ("Don't
share state between processes! etc.")
Here's the code: https://github.com/eventbrite/nose-picker/
Here's the pypi link: https://pypi.python.org/pypi/nose-picker
More details are in those links, like how it works.
Please let me know if you have any questions!
Eyal
More information about the testing-in-python
mailing list