A pytest plugin to detect completely untested functions using coverage.
Motivation
If you add pytest-everyfunc to your CI, you can prevent yourself from checking in code that adds functions without tests.
Installation
$ pip install pytest-everyfunc
Usage
$ pytest --cov=mypackage --fail-on-untested ... tests/test_script.py ........ [100%] mypackage/foo.py:253: untested function: rv_logpdf mypackage/bar.py:717: untested function: norms mypackage/baz.py:86: untested function: prior_predictive_check_plot Exit: Untested functions found.
The output shows the functions that were not called.
If –fail-on-untested is set, then the exit code is 32 (regardless whether tests succeed).
$ echo $? 32
git hook
add to .git/hooks/pre-commit the pytest command above.
Metadata
Release files for pytest-everyfunc 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytest_everyfunc-0.1.4.tar.gz | 4.4 kB | Details |
Release files / pytest_everyfunc-0.1.4.tar.gz
| Download URL | pytest_everyfunc-0.1.4.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ad5d3931bc0afd2e0db76fa95f716188e949b2700848b34cb87240832f6b121
|
|
BLAKE2b-256 checksum How to use checksums |
3ff5511417b57c40100d0c23e7f8804d757a5e95534fd4fb1c548452d82b0bba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|