Search code examples
pythonunit-testingnosepython-nose

Run multiprocess


I'm trying to run tests in parallel using nose.

I have setup a nose.cfg file to contain the following:

[nosetests]
verbosity=2
processes=2

I need to be able to run the programatically using either nose.main() or nose.run(). Whats the best way to do this? How do I select the test location?


Solution

  • You should invoke nose in Python code like this:

    nose.run(defaultTest=test_location)
    

    That'll run nose on tests beneath test_location (typically a directory).