pytest-cagoule is a pytest plugin to find which tests interact with the code you’ve just changed.
Usage
Collect coverage information using --pytest-cov coverage contexts.
py.test --cov --cov-context=test
Then, to run the subset of tests that touch a particular file, use cagoule-select=<filename>[:line number], e.g.
py.test --cagoule-select=path/to/file.py
If you are using git, cagoule can find the files and lines that have changes in the current working directory:
py.test --diff
or for any other diff spec that git can parse, using --diff=<spec>, e.g.
py.test --diff=head~1..head
You probably want to configure your CI server to handle capturing.
Installing
Install pytest-cagoule using pip:
pip install pytest-cagoule
Caveats
Only lines executed during individual test runs are captured. This often excludes module level code, which is executed at import time, before the test starts. Also, tests are of course registered against the code as it was when data was captured, so if using --diff, no new tests will be included.
Inspiration
Idea from nose-knows
License
MIT. See LICENSE for details
Metadata
Release files for pytest-cagoule 0.4.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-cagoule-0.4.0.tar.gz | 5.4 kB | Without provenance | Details for pytest-cagoule-0.4.0.tar.gz |
Release files / pytest-cagoule-0.4.0.tar.gz
| Download URL | pytest-cagoule-0.4.0.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6623f9769a35581da1bdfa747bf0845805ef78bc7f89b5ad0ee4d97b720cbb6b
|
|
BLAKE2b-256 checksum How to use checksums |
832fb1013dc16a8dd30a6f7e1ef7f876269f2d957e9d07d9c5a2206a570115ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/43.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.1
|
Security for pytest-cagoule 0.4.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.