Reputation: 221
Is there any way to use parallel/ concurrent testing in py test? If not can any one please recommend good solution to do parallel testing of several test cases in python 3?
Upvotes: 2
Views: 1353
Reputation: 3180
pytest actually has plugin called pytest-xdist, which allows you to parallelize test runs.
Once you install that plugin, you can run the tests using multiple processes, for instance on 4 CPUs:
pytest -n 4
You might need to adapt the tests for them to be parallelization-friendly, but if they are already well isolated, this should just work!
Upvotes: 1