Parellise tests with posix jobserver.
Project description
pytest-jobserver
Parellise 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_MAKEFLAGS
MAKEFLAGS
MFLAGS
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 dev
to install depsmake lint
to lint code (will change files)make test
to run lint/unit testsmake integrate
to run integration tests
Changelog
0.2.0
Features
- can run against a jobserver specified with
make
environment 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
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
Hashes for pytest_jobserver-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e454c557ecef6018c5a75f82d6f7910f6ad814a192d06ce79c66f41f6f2abccc |
|
MD5 | 64677a5ea065b45472a5b3447a01deb7 |
|
BLAKE2b-256 | 90c0848e86fdd9cf913c30cc215ef3ab7a3d50bc5f2a4b0e40b48a8701ad67a5 |