pytest-coverage
What it does
This tool helps you check if all your code is being tested. It shows you which parts of your code are not being tested so you can add more tests.
When to use it
- ✓When you want to ensure all your tests cover the code.
- ✓When you need to find parts of the code without tests.
- ✓When the goal is for 100% of your code to be tested.
Skill link
https://github.com/github/awesome-copilot/blob/main/skills/pytest-coverage/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Check my project's test coverage and show me where tests are missing.”
5 new skills a week. 1 minute to read.
How it works
The tool runs your tests and checks which lines of code were executed. It creates a report showing the lines that were not tested, marked with a '!'.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
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.
FAQ
What does 'code coverage' mean?
Code coverage is a metric that indicates which parts of your code were executed by your tests. The goal is to have 100% of the code covered.
What is the 'cov_annotate' directory?
It's a folder where the tool saves files that show line by line which parts of your code were tested and which were not.
How do I know if I need to add more tests?
If a code file in the report has lines marked with '!', it means those lines were not tested and you need to add tests for them.
Details
Original description by the author
Run pytest tests with coverage, discover lines missing coverage, and increase coverage to 100%.
repo: github/awesome-copilot
Popularity
- GitHub stars
- 40k
- Ranking position
- #7349
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
acquire-codebase-knowledge
40kHelps your agent understand and document an existing code project. It's useful for onboarding new people or getting an overview of the architecture.
acreadiness-assess
40kEnables your agent to assess a project's readiness for AI and generate a report. It's useful for understanding how well a project is prepared to use AI tools.
acreadiness-generate-instructions
40kHelps your agent create instructions for AI tools based on an assessment. It's useful for improving how AI interacts with code and closing identified gaps.
acreadiness-policy
40kEnables your agent to help define or apply policies for AI project assessment. It's useful for standardizing how projects are evaluated and ensuring compliance.
Similar skills
test-driven-development
311kTeaches your agent to write a failing test first, watch it fail, then write the smallest code that passes, before building any feature or fix.
verification-before-completion
311kTeaches your agent to run real checks and read their output before claiming that a task, fix, or build is complete or passing.
migrate-to-shoehorn
310kReplaces risky type casts in your test files with the shoehorn library, so tests can use partial data and still pass type checks.