Test & Code cover image

Test & Code

pytest-cov : The pytest plugin for measuring coverage

Jan 23, 2025
12:02

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.

 Learn pytest

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode