
About Coverage.py
Coverage.py is a tool for measuring code coverage in Python programs. It shows which lines your tests run and which lines they miss.
What it does
You run your test suite with coverage run, and the tool records which parts of the code were executed. It then analyses the source files to find code that could have run but did not. Branch coverage measurement is supported, and it works with pytest, unittest and other test runners. Plug-ins and configuration options let you choose which files count.
Key features
- Line and branch coverage measurement
- Works with pytest, unittest and other runners
- Settings for source files and exclusions
- Plug-in support for extra behaviour
Who it's for
Python developers who want to see which code their tests actually exercise, and teams that track coverage in continuous integration.
Pricing and good to know
Coverage.py is Apache-2.0 licensed and free. It supports Python 3.11 and later, including free-threaded builds, and PyPy 3.11. An enterprise subscription through Tidelift is also offered. The GitHub repository has about 3.4k stars.
Highlights
- Measure line and branch coverage
- Run with pytest, unittest or other runners
- Choose source files and exclusions
- Plug-ins for extra behaviour












