pytest-jobserver
Limit parallel tests with posix jobserver.
Installation
Install with pip:
pip install pytest-jobserver
The plugin officially supports Python >= 3.6 on a Linux OS.
You may find other Python 3 versions/MacOS work as well.
Usage
The plugin uses a POSIX jobserver to manage parallel test loading.
Pass the --jobserver argument with a path, where this path points to a named pipe acting as a jobserver.
You should probably also use pytest-xdist to enable parallelism in the first place:
pytest -n4 --jobserver /opt/jobserver
You can also pass this filepath via the PYTEST_JOBSERVER environment variable.
make
The plugin can also listen for an existing jobserver as created by make.
If a jobserver is not configured by filepath, pytest-jobserver will check the following environment variables in order:
CARGO_MAKEFLAGSMAKEFLAGSMFLAGS
Please note: it is not possible to use one of these environment variables with pytest-xdist. The execnet protocol used by xdist does not support passing file descriptors to remote child processes.
Implementation
This plugin wraps pytest's call to pytest_runtest_protocol, which is called to actually run a collected item on the worker node.
Development
See the top level Makefile and .circleci/config.yml for the development flow. But in essence:
make devto install depsmake lintto lint code (will change files)make testto run lint/unit testsmake integrateto run integration tests
Changelog
0.3.0
Features
- a jobserver filepath can also be configured by the
PYTEST_JOBSERVERenvironment variable
0.2.2
Bugfixes
- move jobserver status on startup to official
pytest_report_headerhook
0.2.1
Bugfixes
- remove
pytest-xdistfrom runtime dependencies
0.2.0
Features
- can run against a jobserver specified with
makeenvironment variables- note that this will deliberately not work when also using
pytest-xdist
- note that this will deliberately not work when also using
0.1.1
Bugfixes
- fix setup.py package metadata
0.1.0
Features
- can run against a jobserver specified at the cli
TODO
- run against cli jobserver
- integrate with Make jobserver from environment variables
- factor out creation of jobservers to seperate python package
Metadata
Release files for pytest-jobserver 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pytest-jobserver-0.3.0.tar.gz | 7.1 kB | Without provenance | Details for pytest-jobserver-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pytest_jobserver-0.3.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for pytest_jobserver-0.3.0-py2.py3-none-any.whl |
Total release size: 14.2 kB
Release files / pytest-jobserver-0.3.0.tar.gz
| Download URL | pytest-jobserver-0.3.0.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8e007f420bd1eb7874265233b290062c245453fe55f5681c4efdef74eb5ecc3
|
|
BLAKE2b-256 checksum How to use checksums |
0b490f9e938904a5570ab0d7dd6eb0467c16d30829ec3012c3c0c8a2f1016ef2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
|
Release files / pytest_jobserver-0.3.0-py2.py3-none-any.whl
| Download URL | pytest_jobserver-0.3.0-py2.py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
3776c55010e42ae7d0ed72dbe0cd4d50fc1064e0e6b2d00455ecacae1b269b9d
|
|
BLAKE2b-256 checksum How to use checksums |
39b7984857b83c93ca614c474dc36be02231b22cab2c2d49d77e3aad8787e931
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
|
Security for pytest-jobserver 0.3.0
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.