Skip to main content

pytest-jobserver

PyPI version Python versions Code coverage Build status

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 deps
  • make lint to lint code (will change files)
  • make test to run lint/unit tests
  • make integrate to run integration tests

Changelog

0.2.1

Bugfixes

  • remove pytest-xdist from runtime dependencies

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

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-jobserver-0.2.1.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_jobserver-0.2.1-py2.py3-none-any.whl (6.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pytest-jobserver-0.2.1.tar.gz.

File metadata

  • Download URL: pytest-jobserver-0.2.1.tar.gz
  • Upload date:
  • Size: 6.9 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

Hashes for pytest-jobserver-0.2.1.tar.gz
Algorithm Hash digest
SHA256 c207cd3735daaf5fd7689b82b45e62407468f5012717d06562b0c15aecd56c8b
MD5 ec0f0e829d1bcde89b0b9d027214c651
BLAKE2b-256 320e500a4a7dcf3cc8b30bf933fa549b6ac9801d22ac25dd34876bab745a87d4

See more details on using hashes here.

File details

Details for the file pytest_jobserver-0.2.1-py2.py3-none-any.whl.

File metadata

  • Download URL: pytest_jobserver-0.2.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.9 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

Hashes for pytest_jobserver-0.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 48354775b8e518377b7b9c492e647a9df88fe4a0016affb32a1b7485ce6d357a
MD5 bcce043cd43cf643df726da4d20ed9da
BLAKE2b-256 fea5f4877fb915a40faeb8d9f49af8ea102a899486aa12b05caf466d33010b74

See more details on using hashes here.

Release history Release notifications | RSS feed

1.1.0

2 files

1.0.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.2

2 files

This release

0.2.1 This release

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

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