Skip to content
Artwork for Test & Code
Test & Code · Jan 23, 2025 · 12 min

225: pytest-cov : The pytest plugin for measuring coverage

pytest-cov is a pytest plugin that helps produce coverage reports using Coverage.py. In this episode, we'll discuss: what Coverage.py is why you should measure code coverage on both your source and test code what pytest-cov is extra features pytest-cov gives you over and above coverage.py and generally why using both is awesome Links: coverage.py pytest-cov how to set up context reports Top pytest Plugins Errata: I mentioned that Coverage has the ability to show context (which line is covered by which test) for the past year or so. However, that feature was released in Oct 2018. coverage 5.0 alpha That's over 6 years. Oops. Sorry Ned.

0:00-12:28

transcript

No transcript — this publisher did not publish one.

show notes

pytest-cov is a pytest plugin that helps produce coverage reports using Coverage.py.

In this episode, we'll discuss:

  • what Coverage.py is
  • why you should measure code coverage on both your source and test code
  • what pytest-cov is
  • extra features pytest-cov gives you over and above coverage.py
  • and generally why using both is awesome

Links:

Errata:

  • I mentioned that Coverage has the ability to show context (which line is covered by which test) for the past year or so.
    • However, that feature was released in Oct 2018. coverage 5.0 alpha 
    • That's over 6 years. Oops. Sorry Ned.



links5