Version 7.7.0 — 2025-03-16
- The Coverage object has a new method, Coverage.branch_stats() for getting simple branch information for a module. Closes issue 1888.
- The Coverage constructor now has a
plugins
parameter for passing in plugin objects directly, thanks to Alex Gaynor. - Many constant tests in if statements are now recognized as being optimized away. For example, previously
if 13:
would have been considered a branch with one path not taken. Now it is understood as always true and no coverage is missing. - The experimental sys.monitoring support now works for branch coverage if you are using Python 3.14.0 alpha 6 or newer. This should reduce the overhead coverage.py imposes on your test suite. Set the environment variable
COVERAGE_CORE=sysmon
to try it out. - Confirmed support for PyPy 3.11. Thanks Michał Górny.
➡️ PyPI page: coverage 7.7.0.
➡️ To install: python3 -m pip install coverage==7.7.0