Skip to main content

Code coverage measurement for Python

Project description

Code coverage testing for Python.

Stand with Ukraine
PyPI status License Python versions supported
Test suite status Quality check status Documentation Coverage reports
Tidelift Sponsor me on GitHub GitHub stars coveragepy on Mastodon nedbat on Mastodon measures code coverage, typically during test execution. It uses the code analysis tools and tracing hooks provided in the Python standard library to determine which lines are executable, and which have been executed. runs on these versions of Python:

  • Python 3.8 through 3.12, and 3.13.0a3 and up.

  • PyPy3 versions 3.8 through 3.10.

Documentation is on Read the Docs. Code repository and issue tracker are on GitHub.

New in 7.x: experimental support for sys.monitoring; dropped support for Python 3.7; added Coverage.collect() context manager; improved data combining; [run] exclude_also setting; report --format=; type annotations.

New in 6.x: dropped support for Python 2.7, 3.5, and 3.6; write data on SIGTERM; added support for 3.10 match/case statements.

For Enterprise


Available as part of the Tidelift Subscription. Coverage and thousands of other packages are working with Tidelift to deliver one enterprise subscription that covers all of the open source you use. If you want the flexibility of open source and the confidence of commercial-grade software, this is for you. Learn more.

Getting Started

Looking to run coverage on your test suite? See the Quick Start section of the docs.

Change history

The complete history of changes is on the change history page.

Code of Conduct

Everyone participating in the project is expected to treat other people with respect and to follow the guidelines articulated in the Python Community Code of Conduct.


Found a bug? Want to help improve the code or documentation? See the Contributing section of the docs.


To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.


Licensed under the Apache 2.0 License. For details, see NOTICE.txt.

Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coverage-7.4.3.tar.gz (783.2 kB view hashes)

Uploaded source

Built Distributions

coverage-7.4.3-pp38.pp39.pp310-none-any.whl (199.0 kB view hashes)

Uploaded pp38 pp39 pp310

coverage-7.4.3-cp312-cp312-win_amd64.whl (210.1 kB view hashes)

Uploaded cp312

coverage-7.4.3-cp312-cp312-win32.whl (209.2 kB view hashes)

Uploaded cp312

coverage-7.4.3-cp311-cp311-win_amd64.whl (209.9 kB view hashes)

Uploaded cp311

coverage-7.4.3-cp311-cp311-win32.whl (209.0 kB view hashes)

Uploaded cp311

coverage-7.4.3-cp310-cp310-win_amd64.whl (209.8 kB view hashes)

Uploaded cp310

coverage-7.4.3-cp310-cp310-win32.whl (209.0 kB view hashes)

Uploaded cp310

coverage-7.4.3-cp39-cp39-win_amd64.whl (209.9 kB view hashes)

Uploaded cp39

coverage-7.4.3-cp39-cp39-win32.whl (209.0 kB view hashes)

Uploaded cp39

coverage-7.4.3-cp38-cp38-win_amd64.whl (209.8 kB view hashes)

Uploaded cp38

coverage-7.4.3-cp38-cp38-win32.whl (209.0 kB view hashes)

Uploaded cp38

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page