Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
github avatar

Pytest Coverage

  • 11.9k installs
  • 37.1k repo stars
  • Updated July 28, 2026
  • github/awesome-copilot

A CLI tool that runs pytest with coverage instrumentation, generates annotated source files showing uncovered lines, and helps developers write tests to reach 100% coverage.

About

pytest-coverage runs pytest with coverage analysis to identify lines of code not covered by tests. Developers use it during the testing phase to generate annotated coverage reports showing which lines lack test coverage, marked with exclamation marks. The workflow involves running coverage commands, reviewing annotated source files in the cov_annotate directory, identifying gaps, writing additional tests, and iterating until reaching 100% coverage. Key commands include pytest --cov with optional module specification and annotated report output.

  • Generate coverage reports with pytest --cov --cov-report=annotate:cov_annotate
  • Specify modules to check coverage for targeted analysis
  • Annotated source files show uncovered lines marked with ! prefix
  • Iterate test writing based on coverage gaps until 100% achieved
  • Review only files with less than 100% coverage for efficiency

Pytest Coverage by the numbers

  • 11,938 all-time installs (skills.sh)
  • +193 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #62 of 2,184 Testing & QA skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

pytest-coverage capabilities & compatibility

Capabilities
generate coverage reports · annotate source files with coverage status · identify uncovered lines · target specific modules for coverage analysis
Use cases
testing · code review
Platforms
macOS · Windows · Linux
From the docs

What pytest-coverage says it does

Generate a coverage report with: pytest --cov --cov-report=annotate:cov_annotate
SKILL.md
If a line starts with a ! (exclamation mark), it means that the line is not covered by tests.
SKILL.md
The goal is for the tests to cover all lines of code.
SKILL.md
npx skills add https://github.com/github/awesome-copilot --skill pytest-coverage

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs11.9k
repo stars37.1k
Security audit3 / 3 scanners passed
Last updatedJuly 28, 2026
Repositorygithub/awesome-copilot

What it does

Measure and improve test coverage to 100% by identifying uncovered lines and generating coverage reports.

Who is it for?

Python projects requiring comprehensive test coverage validation and gap analysis before release.

Skip if: Projects that do not use pytest or Python; teams without testing infrastructure.

When should I use this skill?

Running test suites and measuring code coverage; during code review to validate test completeness; before major releases.

What you get

Developers achieve 100% test coverage by using coverage reports to identify and test previously uncovered code paths.

  • Coverage report in cov_annotate directory
  • Annotated source files showing covered and uncovered lines
  • List of uncovered code gaps

By the numbers

  • Coverage goal is 100% of all lines in source code

Files

SKILL.mdMarkdownGitHub ↗

The goal is for the tests to cover all lines of code.

Generate a coverage report with:

pytest --cov --cov-report=annotate:cov_annotate

If you are checking for coverage of a specific module, you can specify it like this:

pytest --cov=your_module_name --cov-report=annotate:cov_annotate

You can also specify specific tests to run, for example:

pytest tests/test_your_module.py --cov=your_module_name --cov-report=annotate:cov_annotate

Open the cov_annotate directory to view the annotated source code. There will be one file per source file. If a file has 100% source coverage, it means all lines are covered by tests, so you do not need to open the file.

For each file that has less than 100% test coverage, find the matching file in cov_annotate and review the file.

If a line starts with a ! (exclamation mark), it means that the line is not covered by tests. Add tests to cover the missing lines.

Keep running the tests and improving coverage until all lines are covered.

Related skills

How it compares

Pick pytest-coverage over generic testing skills when the explicit goal is annotated gap discovery and driving coverage to 100%.

FAQ

How do I run pytest with coverage?

Run pytest --cov --cov-report=annotate:cov_annotate to generate coverage reports with annotated source files in the cov_annotate directory.

How do I identify uncovered lines?

Open the cov_annotate directory and look for files with less than 100% coverage. Lines starting with ! are not covered by tests.

How do I check coverage for a specific module?

Use pytest --cov=your_module_name --cov-report=annotate:cov_annotate to check coverage only for that module.

Is Pytest Coverage safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.