Overview
THIS PLUGIN IS IN DEVELOPMENT -- Expect bugs. Expect incomplete behaviour
pytest-maxcov is a pytest plugin to compute the maximum coverage available through pytest with the minimum execution time cost. The plugin serves two main use cases:
- to identify redundant unit tests which do not add additional coverage
- to discover a subset of unit tests which achieves a minimum coverage level, for example to create a fast subset for a smoke test
Installation
python3 -m pip install pytest-maxcov
Usage
The plugin works in two passes:
- Run alongside
pytest-covto collect coverage information and time every test. Pass--maxcov-recordon the command-line topytestto configure the plugin to capture the data it needs for the second pass. You must also include--cov-context=textto that per-test coverage can be measured. - Run using
--maxcovto read the data from pass one to mark tests as skipped if they are not needed to achieve the chosen coverage level.
The command-line option --maxcov-threshold specifies the threshold for computing the minimum set of tests. By default this is 100%.
For example using Poetry and pytest-xdist:
poetry run pytest -n logical --maxcov-record --cov=mypackage --cov-branch --cov-context=test
poetry run pytest -n logical --maxcov --cov=mypackage --cov-branch
Limitations
Current limitations include:
- multiple contexts are not supported; the plugin assumes everything runs in a single context
- multiple coverage files are not supported; the plugin reads from
.coverageby default or the data file specified by the environment variableCOVERAGE_FILE
License
All code in this repository is licensed under the MIT License
Metadata
Release files for pytest-maxcov 1.0.1
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_maxcov-1.0.1.tar.gz | 81.0 kB | Without provenance | Details for pytest_maxcov-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pytest_maxcov-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for pytest_maxcov-1.0.1-py3-none-any.whl |
Total release size: 86.8 kB
Release files / pytest_maxcov-1.0.1.tar.gz
| Download URL | pytest_maxcov-1.0.1.tar.gz |
|---|---|
| Size | 81.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e02bb60c450eab81116cc8b777bde8c7237f6c76ffea56a7aa744c5ad8235bdd
|
|
BLAKE2b-256 checksum How to use checksums |
b3b593c2ff010ab1d514bc165b1871fc9d2e26459fbb90c9f15c5991c1262c78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / pytest_maxcov-1.0.1-py3-none-any.whl
| Download URL | pytest_maxcov-1.0.1-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1e1083f406a794db1758e8b8685de5e46eb66b299057ea4c80bf030cc1ad445a
|
|
BLAKE2b-256 checksum How to use checksums |
a3b7f3e6f29007820f219e96f13da32aeed9b7e269db46a3812430091ed52b67
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for pytest-maxcov 1.0.1
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.