pytest-coverage
Lets your agent run code tests and check if everything is working well. It helps find and fix parts of the code not being tested.
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.
Example of what to ask your AI
“Check my project's test coverage and show me where tests are missing.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
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 '!'.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add github/awesome-copilot --skill pytest-coverageOr download just the file:
curl -L https://raw.githubusercontent.com/github/awesome-copilot/main/skills/pytest-coverage/SKILL.md -o SKILL.mdTechnical 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
- #5292
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
acquire-codebase-knowledge
Helps your agent understand and document an existing code project. It's useful for onboarding new people or getting an overview of the architecture.
github/awesome-copilot
acreadiness-assess
Enables 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.
github/awesome-copilot
acreadiness-generate-instructions
Helps 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.
github/awesome-copilot
acreadiness-policy
Enables your agent to help define or apply policies for AI project assessment. It's useful for standardizing how projects are evaluated and ensuring compliance.
github/awesome-copilot
Similar skills
cpp-testing
Makes your agent write and improve tests for C++ code. It helps set up testing tools and fix errors.
affaan-m/ECC
csharp-testing
Helps your agent create tests for C# and .NET code. It uses best practices to ensure tests are efficient and reliable.
affaan-m/ECC
django-tdd
Enables your agent to apply testing strategies for Django with pytest-django and TDD. It's useful for writing robust tests and ensuring code quality, especially for DRF APIs.
affaan-m/ECC