Skip to main content

pytest-parallel

a py.test plugin for parallel and concurrent testing

What?

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

Why?

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.

Requirements

  • Python3 version [3.6+]
  • Unix or Mac for parallelism

Installation

pip install pytest-parallel

Options

  • 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.

Examples

# 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

License

MIT

Metadata

Release files for pytest-parallel 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-parallel 0.0.2
File Size Uploaded Provenance Actions
pytest-parallel-0.0.2.tar.gz 4.3 kB Without provenance Details for pytest-parallel-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pytest-parallel 0.0.2
File Interpreter ABI Platform Actions
pytest_parallel-0.0.2-py3-none-any.whl Python 3 none any Details for pytest_parallel-0.0.2-py3-none-any.whl

Total release size: 8.8 kB

Release files / pytest-parallel-0.0.2.tar.gz

Download URL pytest-parallel-0.0.2.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8422d9157654ecf84f37dcbcc4cbb86e33a9fa2c40e558852703f308df453768
BLAKE2b-256 checksum
How to use checksums
81894ba0ef36bd6c18fb9c6bafc11df997711ae2ddbcb0ba4285888c3d5f2cd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pytest_parallel-0.0.2-py3-none-any.whl

Download URL pytest_parallel-0.0.2-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f54c59ddf38111e774c1221ade4a0d0c9da5017c01ba5c4921af2daa01371422
BLAKE2b-256 checksum
How to use checksums
b67cd93f3687a9cd5bc1732f054b01b74750c95e51eddc54164515997b4f914d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for pytest-parallel 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page