Skip to main content

Build Status Coverage

xdist-scheduling-exclusive

pytest-xdist scheduler that runs some tests on dedicated workers.

Can significantly improve runtime by running long tests on separate workers.

Also in conftest.py you can find handy reporting capabilities to see how tests were scheduled.

Installation

pip install xdist-scheduling-exclusive pytest-xdist

Usage

To integrate with your pytest setup, update conftest.py as follows:

from xdist_scheduling_exclusive import ExclusiveLoadScopeScheduling

def pytest_xdist_make_scheduler(config, log):
    """xdist-pytest hook to set scheduler."""
    return ExclusiveLoadScopeScheduling(config, log)

And place exclusive tests file exclusive_tests.txt in tests/resources/.

You can get the list with pytest's --durations option that also sort tests by execution time. Do not forget to clear execution time from the file - there should be only test node IDs. See example in this project tests/resources/exclusive_tests.txt.

Placing the slowest tests in exclusive_tests.txt will give you the most benefit.

Available Schedulers:

  • ExclusiveLoadScheduling Schedule tests from exclusive_tests.txt first and on dedicated nodes.
  • ExclusiveLoadFileScheduling: Place tests from exclusive_tests.txt to unique scopes. Other tests are grouped as in --dist loadfile: tests from the same file run on the same node.
  • ExclusiveLoadScopeScheduling: Schedule tests from exclusive_tests.txt first and on dedicated nodes. Other tests are grouped as in --dist loadfile: tests from the same file run on the same node.

Developers

Do not forget to run . ./activate.sh.

To see how tests were scheduled use something like

python -m pytest -n 4 --xdist-report -s

Scripts

make help

Coverage report

Metadata

Release files for xdist-scheduling-exclusive 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xdist-scheduling-exclusive 1.2.0
File Size Uploaded Provenance
xdist_scheduling_exclusive-1.2.0.tar.gz 15.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for xdist-scheduling-exclusive 1.2.0
File Interpreter ABI Platform
xdist_scheduling_exclusive-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.8 kB

Release files / xdist_scheduling_exclusive-1.2.0.tar.gz

Download URL xdist_scheduling_exclusive-1.2.0.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4ae4f1a1556ba79abda730d12863953298f82f15287af65afd4a459669398cf7
BLAKE2b-256 checksum
How to use checksums
0f1ec27300db7359387f3c5047a4f5039937d26ea829fc197730265a4025f334
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.18

Release files / xdist_scheduling_exclusive-1.2.0-py3-none-any.whl

Download URL xdist_scheduling_exclusive-1.2.0-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
125964295434615b42307661dba06442ffa520685ab7b286709c3989630a1f4c
BLAKE2b-256 checksum
How to use checksums
1a5bcfd41de76e4849a60169326602ddb9784d40b2433ebe65e74390ef6357ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.18

Security for xdist-scheduling-exclusive 1.2.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.

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