Registry / testing / pytest-xdist-worker-stats

pytest-xdist-worker-stats

JSON →
library0.4.0pypypiunverified

pytest-xdist-worker-stats is a pytest plugin that provides detailed statistics about individual worker performance after a pytest-xdist run, including test counts and execution times. The current version is 0.4.0, and it maintains an active, moderate release cadence.

pip install pytest-xdist-worker-stats
INSTALL
IMPORT
SIG · PYTEST-XDIST-WORKE
P
pytest-xdist-worker-stats
testingpythonv0.4.0
Install
2.8s avg
Import
Disk
30MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.4.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 31.5MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 2.8s · import 0.000s · 32MB
30MB installed
● package 30MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pytest-xdist-worker-stats
No direct import needed; pytest discovers plugins automatically.
Pytest plugins are designed for automatic discovery by pytest itself. Users typically do not need to import anything directly from 'pytest-xdist-worker-stats' in their test files or conftest.py.

This quickstart demonstrates how to use `pytest-xdist-worker-stats` by creating a simple test file with parameterized tests that will be run in parallel by `pytest-xdist`. The `--xdist-worker-stats` flag will activate the plugin and display the worker statistics after the test run.

import time import pytest @pytest.mark.parametrize("i", range(5)) def test_slow_task_a(i): time.sleep(0.1) @pytest.mark.parametrize("i", range(3)) def test_slow_task_b(i): time.sleep(0.2) # To run: save this as test_example.py, then run from your terminal: # pip install pytest pytest-xdist pytest-xdist-worker-stats # pytest -n 2 --xdist-worker-stats test_example.py
Debug
Known issues
gotchaThis plugin requires `pytest-xdist` to be installed and active (by using the `-n` flag with pytest) to function correctly. Without `pytest-xdist`, there are no parallel workers to report statistics for.
fix
Ensure `pip install pytest-xdist` is executed and pytest is run with a parallelization flag, e.g., `pytest -n auto`.
affects: All
gotchaThe worker statistics are only displayed when the `--xdist-worker-stats` command-line flag is explicitly used with pytest. Simply installing the plugin is not enough.
fix
Always include `--xdist-worker-stats` in your pytest command, e.g., `pytest -n auto --xdist-worker-stats`.
affects: All
breakingVersion 0.4.0 introduces support for Pytest 9. Older versions of `pytest-xdist-worker-stats` may not be compatible with Pytest 9, and conversely, newer versions might introduce incompatibilities with significantly older Pytest versions (e.g., Pytest 7 or earlier).
fix
Always keep `pytest-xdist-worker-stats` updated alongside `pytest` and `pytest-xdist` to ensure compatibility. Check release notes for specific version requirements.
affects: <0.4.0 (with Pytest 9)
gotchaThe library requires Python 3.10 or newer. Running it with older Python versions will result in installation or runtime errors.
fix
Ensure your environment uses Python 3.10 or a more recent version. Consider using `pyenv` or `conda` to manage Python versions.
affects: All
Upgrade
Version history
0.4.0latest on PyPI · released Feb 16, 2026
Audit
Dependencies
pytestrequiredCore testing framework
pytest-xdistrequiredRequired for parallel test execution and worker management, which this plugin extends
Agent activity
10 hits · last 30 days
node
8
Amazon
1
Resources
pytest-xdist-worker-stats — pip install pytest-xdist-worker-stats · libregistry