
Coverage.py
Summary
Coverage.py measures which parts of Python programs run and which executable code remains untouched, helping developers assess what their tests exercise. It measures statement coverage by default and can also report branch coverage. Available report formats include text, HTML, XML, LCOV, and JSON. Dynamic contexts can associate executed lines with the test function that ran them. Coverage.py can run test suites through their usual command; pytest-cov is available, though the documentation says it is unnecessary for most users. Third-party plugins can extend measurement to non-Python files, such as mapping executed Python to Django templates. Data is stored in a SQLite database, and advanced use can rely on the Coverage.py API. The documentation lists Python 3.10 through 3.15 rc2 and PyPy3 3.10 and 3.11. It offers ctrace, pytrace, and sysmon tracing cores; sysmon is faster for simple line and branch coverage but does not support dynamic contexts or plugins. Coverage.py is Apache 2.0 licensed and runs on Linux, macOS, and Windows, with self-hosting available.
Who it is for
Coverage.py is for developers measuring how much of their Python code their tests exercise. Its report formats and dynamic contexts can help teams inspect coverage in different ways.
What is good
- Measures statement and branch coverage.
- Produces five report formats, including HTML and JSON.
- Dynamic contexts can link lines to test functions.
- Supports Linux, macOS, and Windows.
What to know first
- Sysmon does not support dynamic contexts or plugins.
- Documentation lists Python through 3.15 rc2.
- Professional support is through a Tidelift Subscription.
Verdict
Coverage.py provides Python test-coverage measurement with several report formats and tracing options. Choose a tracing core based on whether you need plugins or dynamic contexts.
Coverage.py plans and pricing
All plansCompared on test coverage tools
- Free plan
- Yescoverage.readthedocs.io
- Coverage types
- statement, branchcoverage.readthedocs.io
- Supported languages
- Pythoncoverage.readthedocs.io
- Report formats
- text, HTML, XML, LCOV, JSONcoverage.readthedocs.io
- Self-hosted option
- Yescoverage.readthedocs.io
- Coverage gates
- Yescoverage.readthedocs.io
Facts
- Purpose
- Coverage.py measures which parts of Python programs ran and identifies executable code that did not run, commonly to gauge test effectiveness.coverage.readthedocs.io · 3 Oct 2026
- Reports
- It can produce text, HTML, XML, LCOV, and JSON reports.coverage.readthedocs.io · 3 Oct 2026
- Contexts
- Dynamic contexts can record which test function ran which lines of code.coverage.readthedocs.io · 3 Oct 2026
- Integrations
- Coverage.py can run test suites through their usual command, and pytest-cov is an available pytest plugin that the docs say is unnecessary for most purposes.coverage.readthedocs.io · 3 Oct 2026
- Extensibility
- Third-party plugins can extend measurement to non-Python files, such as mapping executed Python back to Django HTML templates.coverage.readthedocs.io · 3 Oct 2026
- Storage and API
- Coverage data is stored in a SQLite database, and advanced usage can use the Coverage.py API.coverage.readthedocs.io · 3 Oct 2026
- Supported interpreters
- The current documentation lists Python 3.10 through 3.15 rc2, including free-threading, and PyPy3 versions 3.10 and 3.11.coverage.readthedocs.io · 3 Oct 2026
- Measurement cores
- Coverage.py offers ctrace and pytrace tracing cores plus a sysmon core; sysmon is faster for simple line and branch coverage but does not yet support dynamic contexts or plugins.coverage.readthedocs.io · 3 Oct 2026
- Security
- The project directs vulnerability reports to Tidelift, which it says will coordinate the fix and disclosure.github.com · 3 Oct 2026
- License
- Coverage.py is licensed under the Apache 2.0 License.github.com · 3 Oct 2026
- Support
- Users can seek help on the Python discussion forums or Python Discord, report bugs on GitHub, and obtain professional support through Tidelift Subscription.coverage.readthedocs.io · 3 Oct 2026
- Intended users
- The documentation presents Coverage.py as a tool for people measuring Python test effectiveness by seeing which code tests exercise and which they miss.coverage.readthedocs.io · 3 Oct 2026
Best Coverage.py alternatives
See all 12Where it ranks on Everything Xiaomi
- Best Test Coverage Tools in 2026#5 of 26
Is Coverage.py yours?
Claim it for free: prove the domain, then correct facts, plans and screenshots. An editor reviews every change.
Sources
- coverage.readthedocs.io/en/7.16.2/· checked 3 Oct 2026
- coverage.readthedocs.io/en/7.16.2/faq.html· checked 3 Oct 2026
- coverage.readthedocs.io/en/7.16.2/howitworks.html· checked 3 Oct 2026
- github.com/coveragepy/coveragepy· checked 3 Oct 2026
