Skip to main content

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)

Source distribution for pytest-everyfunc 0.1.4
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

Release history Release notifications | RSS feed

This release

0.1.4 This release

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page