Registry / testing / coverage

coverage

JSON →
library7.13.5pypypi✓ verified 35d ago

Coverage.py is a tool for measuring code coverage of Python programs, currently at version 7.13.5, released on March 17, 2026. It is actively maintained with regular updates addressing various issues and enhancements.

testing
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Ensure correct import path to access the Coverage class

from coverage import Coverage

Basic usage of Coverage.py to measure code coverage and generate an HTML report.

import os from coverage import Coverage # Start coverage measurement cov = Coverage() cov.start() # Your code to test # ... # Stop coverage measurement cov.stop() # Generate HTML report cov.html_report(directory=os.environ.get('COVERAGE_REPORT_DIR', 'covhtml'))
coverage --version
Debug
Known footguns
breakingIn version 7.11.1, conflicts between a requested measurement core and other settings raised an error, which was a breaking change from previous behavior. This has been restored in version 7.11.3 to use another core instead and issue a warning.
gotchaWhen using the 'sysmon' measurement core in version 7.11.1, a 'NotPython' exception could be raised if Python code was claimed to come from a non-Python file, such as Jinja templates compiled to Python. This issue has been fixed in version 7.11.2.
breakingThe 'coverage' library failed with a 'NoDataError' during report generation because no data was collected. This typically happens when the code intended for coverage measurement is not executed or when coverage data files are not properly saved or loaded in the current environment.
gotchaThe `coverage.exceptions.NoDataError: No data to report.` occurs when no Python code is executed or recorded by the Coverage.py tool, leading to no coverage data being collected. This is often preceded by a `CoverageWarning: No data was collected. (no-data-collected)` message.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
0 hits · last 30 days

No traffic data recorded yet.

Resources