Limit parallel tests with posix jobserver.
Project description
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
The plugin can also listen for an existing jobserver as created by another tool. Currently the environment variables it supports are:
CARGO_MAKEFLAGSMAKEFLAGSMFLAGS
The environment variables will only be checked when the cli flag is not set.
Please note: it is not supported to use both make environment variables and use 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.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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytest-jobserver-0.2.2.tar.gz.
File metadata
- Download URL: pytest-jobserver-0.2.2.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08d78f07a8f91e27401fbf109f50497260026765356e2ecbcce2b003fbc92c08
|
|
| MD5 |
06a8c4e4eec3c1d946c8b4ed51418119
|
|
| BLAKE2b-256 |
f558938f7e86bbba43899de7b943e8ebe013086bf54f436938759e0301980ad1
|
File details
Details for the file pytest_jobserver-0.2.2-py2.py3-none-any.whl.
File metadata
- Download URL: pytest_jobserver-0.2.2-py2.py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 2, Python 3
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f78fadc62d77adefe77f79d682258e0dbf130ddd83fce24959edd00915512d8e
|
|
| MD5 |
0683245974d260de782847eae1e65a6d
|
|
| BLAKE2b-256 |
ebf0c38586650b1062d820a39ee1c70ea0682d858c9661b4d2a5f491e8bd8b7b
|