a py.test plugin for parallel and concurrent testing
Project description
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:
- aren't threadsafe
- perform poorly when multithreaded
- need state isolation
pytest-parallel
is better for some use cases (like Selenium tests) that:
- can be threadsafe
- can use non-blocking IO for http requests to make it performant
- 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 orauto
which uses one worker per core. Defaults to 1.tests-per-worker
(optional) - max concurrent tests per worker. Can be a positive integer orauto
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pytest-parallel-0.0.1.tar.gz
(4.0 kB
view details)
Built Distribution
File details
Details for the file pytest-parallel-0.0.1.tar.gz
.
File metadata
- Download URL: pytest-parallel-0.0.1.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ec7af88adc9de80702f8cf24344219739e858f13ce32eff60d5aebc4c8cc0a6 |
|
MD5 | 8450d27b852f33647343063eb7c390d7 |
|
BLAKE2b-256 | 837de37b6436427772502be7865cb962b12b2b45562b76fb21a4b3319d041036 |
File details
Details for the file pytest_parallel-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: pytest_parallel-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ad3520cd7ddba56d7af0e2032045e2d7b37674a7f843d9d594ded1d3ae35292 |
|
MD5 | 06fab19b68319db1447888b9b2d54b3e |
|
BLAKE2b-256 | d08935b391071a78f2d83874df7b12ab3ccd75b28aa213b899318c3cfdabb412 |