To run Pytest tests in parallel, install the pytest-xdist plugin:
Use the following command to run tests in parallel:
The -n auto option tells Pytest to distribute the tests across as many CPUs as your machine has available.
If you want more control and wish to specify the number of CPUs yourself, you can pass a number instead of auto:
Got an article suggestion?
Let us know
BY
NC
SA
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.