August 2018
Beginner
160 pages
4h 8m
English
This is a very popular plugin and is maintained by the core developers; it allows you to run tests under multiple CPUs, to speed up the test run.
After installing it, simply use the -n command-line flag to use the given number of CPUs to run the tests:
λ pytest -n 4
And that's it! Now, your tests will run across four cores and hopefully speed up the test suite quite a bit, if it is CPU intensive, thought I/O-bound tests won't see much improvement, though. You can also use -n auto to let pytest-xdist automatically figure out the number of CPUs you have available.
Read now
Unlock full access