github avatar

Pytest Coverage

The pytest-coverage skill runs pytest with coverage analysis to identify untested code lines and helps developers achieve 100% test coverage. It generates annotated source files marking uncovered lines with exclamation marks, allowing developers to systematically write tests for missing coverage. This skill is for Python developers who want to ensure their test suites comprehensively cover all code paths.

skills.sh installs
13K
GitHub stars
41K
last updated
Aug 21, 2026

Install

$ npx -y skills add github/awesome-copilot --skill pytest-coverage --agent claude-code

Installs into .claude/skills of the current project.

Files

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.

Sponsors

Details

Repository
github.com/github/awesome-copilot
Categories
Testing & QA, Git & Pull Requests, AI & Agent Building, Python

More from github/awesome-copilot

All 318
1alwaysmeticulous avatarmeticulous-testalwaysmeticulous/skillsRun a Meticulous test run after implementing a frontend change, then hand off to the `meticulous-review` skill to classify each visual change as intended or uni8.8Kskills.sh installs
2affaan-m avatarai-regression-testingaffaan-m/eccRegression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns t5.7Kskills.sh installs
3affaan-m avatarswift-protocol-di-testingaffaan-m/everything-claude-codeswift protocol di testing5Kskills.sh installs
4trailofbits avatarmutation-testingtrailofbits/skillsConfigures mewt or muton mutation testing campaigns — scopes targets, tunes timeouts, and optimizes long-running runs. Use when the user mentions mewt, muton, m4.7Kskills.sh installs
5dotnet avatarcode-testing-extensionsdotnet/skillsProvides file paths to language-specific extension files for the code-testing pipeline. Call this skill to discover available extension guidance files (e.g., do4.2Kskills.sh installs
6everyinc avatarce-test-browsereveryinc/compound-engineering-pluginRun browser tests for pages affected by the current branch or PR.3.1Kskills.sh installs