Last Updated: June 6, 2026
Coverage tools tell you which lines and branches of your code your tests actually ran. They don't tell you whether your tests are good, but they're great at finding the code paths nobody is exercising. This chapter covers coverage.py, the pytest-cov plugin, the difference between line and branch coverage, how to read the reports, how to configure exclusions, and where coverage stops being useful. Coverage is the layer that sits on top of pytest basics, fixtures, parametrize, and mocking.