pytest-uv
Run your test suite on every Python version you support, in one pytest command.
pytest-uv builds a virtual environment per version with uv, starts one pytest-xdist worker in each, and runs every test once per version. Failures from all versions come back in one report, so a test that breaks only on 3.11 shows up before you push.
Documentation: jirikuncar.github.io/pytest-uv
uv add --dev pytest-uv
uv run pytest --python-versions 3.11,3.12,3.13
created: 3/3 workers
3 workers [4 items]
............ [100%]
============================== 12 passed in 2.01s ==============================
Fits if your project has a pyproject.toml, uv is on PATH, and the matrix you
care about is Python versions. Needs Python 3.11+.
| Versions | An explicit list, declared ([tool.pytest-uv] versions), or auto (installed interpreters allowed by requires-python) |
| Environments | .pytest-uv/py<version>, synced from uv.lock with uv sync --frozen, or installed with uv pip install without a lock file; built in parallel, reused until inputs change |
| Isolation | Each worker imports only from its own environment; your .venv is untouched |
| In tests | sys.version_info markers as usual, plus a python_version fixture ("3.13") |
| Not for | Running linters or docs per version, dependency-version matrices (use tox or nox), or one version over many CPUs (use pytest -n auto) |
Usage
pytest --python-versions 3.12,3.13 # these versions; uv downloads missing ones
pytest --python-versions declared # [tool.pytest-uv] versions
pytest --python-versions auto # installed CPython matching requires-python
pytest --python-versions 3.13 --lf # re-run last failures on one version
[tool.pytest-uv]
versions = ["3.11", "3.12", "3.13", "3.14"]
venv-dir = ".pytest-uv" # ignored by git automatically
sync-args = ["--no-default-groups", "--group", "test"] # with uv.lock
install-args = ["-e", ".", "--group", "test"] # without uv.lock
-n and --pdb cannot be combined with --python-versions: each version gets exactly
one worker, and workers have no terminal. To debug interactively, run the version's
interpreter directly:
.pytest-uv/py3.13/bin/python -m pytest tests/test_foo.py::test_bar --pdb.
In GitHub Actions, one step runs the suite on every supported version:
- uses: jirikuncar/pytest-uv@v0.1.0
with:
python-versions: auto
More in the docs: Quickstart,
GitHub Actions,
Debugging failures,
Configuration,
Comparisons with tox, nox and xdist.
Runnable projects are in examples/.
Coding agents
In Claude Code:
/plugin marketplace add jirikuncar/pytest-uv
/plugin install pytest-uv@pytest-uv
Other agents: Coding agents.
The docs are also available as llms.txt
and llms-full.txt.
Development
git clone https://github.com/jirikuncar/pytest-uv
cd pytest-uv
uv sync
uv run pytest tests/test_plugin.py tests/test_envs.py tests/test_resolver.py
See AGENTS.md for the architecture and the integration tests.
License
MIT
Metadata
Release files for pytest-uv 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pytest_uv-0.1.0.tar.gz | 99.2 kB | With provenance | Details for pytest_uv-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pytest_uv-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pytest_uv-0.1.0-py3-none-any.whl |
Total release size: 113.8 kB
Release files / pytest_uv-0.1.0.tar.gz
| Download URL | pytest_uv-0.1.0.tar.gz |
|---|---|
| Size | 99.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bf81becf00a42c74f62efb34afd176083dc5cf21a74946c3ae6f7c8341ecd2ed
|
|
BLAKE2b-256 checksum How to use checksums |
97aa770f58162fee8d52bb753e9ec4d64ef8c6e09d474c93ac65f4a94cd84734
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.
Transparency logRelease files / pytest_uv-0.1.0-py3-none-any.whl
| Download URL | pytest_uv-0.1.0-py3-none-any.whl |
|---|---|
| Size | 14.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eb0b4fb0d640bc2ab9cb740aea852e3af201444979e0911506d6e88035ac9b6e
|
|
BLAKE2b-256 checksum How to use checksums |
7519ad5db14183bb76c3c2f8ea4a8023fcd145fae0643e57d5fde70fabe68f1c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.
Transparency logSecurity for pytest-uv 0.1.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pytest_uv-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.
Transparency logA 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.