Skip to main content

a pytest plugin for parallel and concurrent testing

Project description


a pytest plugin for parallel and concurrent testing


This plugin makes it possible to run tests quickly using multiprocessing (parallelism) and multithreading (concurrency).


pytest-xdist is great to run tests that:

  1. aren't threadsafe
  2. perform poorly when multithreaded
  3. need state isolation

pytest-parallel is better for some use cases (like Selenium tests) that:

  1. can be threadsafe
  2. can use non-blocking IO for http requests to make it performant
  3. manage little or no state in the Python environment

Put simply, pytest-xdist does parallelism while pytest-parallel does parallelism and concurrency.


  • Python3 version [3.6+]
  • Unix or Mac for --workers
  • Unix, Mac, or Windows for --tests-per-worker


pip install pytest-parallel


  • workers (optional) - max workers (aka processes) to start. Can be a positive integer or auto which uses one worker per core. Defaults to 1.
  • tests-per-worker (optional) - max concurrent tests per worker. Can be a positive integer or auto which evenly divides tests among the workers up to 50 concurrent tests. Defaults to 1.


# runs 2 workers with 1 test per worker at a time
pytest --workers 2

# runs 4 workers (assuming a quad-core machine) with 1 test per worker
pytest --workers auto

# runs 1 worker with 4 tests at a time
pytest --tests-per-worker 4

# runs 1 worker with up to 50 tests at a time
pytest --tests-per-worker auto

# runs 2 workers with up to 50 tests per worker
pytest --workers 2 --tests-per-worker auto



Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pytest-parallel, version 0.0.10
Filename, size File type Python version Upload date Hashes
Filename, size pytest_parallel-0.0.10-py3-none-any.whl (6.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pytest-parallel-0.0.10.tar.gz (9.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page