pytest-coverage — GitHub Copilot skill: install and usage
Runs pytest with coverage, flags lines that tests miss, and guides work toward 100% line coverage. Use it when coverage gaps need concrete test cases.
npx skills add github/awesome-copilot --skill pytest-coverageWhat pytest-coverage does
The skill runs pytest with coverage options and writes an annotated report to cov_annotate. You can target one module with --cov=your_module_name or run a selected test file against that module.
cov_annotate contains one file per source file. Lines starting with ! lack test coverage, so the skill directs you to add tests for them and rerun the suite until line coverage reaches 100%.
Install it if full line coverage is a project requirement. If a broad coverage percentage is enough, this workflow is stricter than you need.
What it helps with
- run pytest with a coverage report
- find source lines missed by tests
- check coverage for one module
- run coverage for a selected test file
- add tests for uncovered lines
Example prompts for the agent
- “Run pytest with coverage and create the `cov_annotate` report.”
- “Check coverage for `your_module_name` and find lines marked with `!`.”
- “Run `tests/test_your_module.py` with coverage for `your_module_name` and add tests for missed lines.”
How to install pytest-coverage
1Skills CLI (Vercel)
npx skills add github/awesome-copilot --skill pytest-coverage2GitHub CLI
gh skill install github/awesome-copilot pytest-coverage3Manually: put the files in place
.github/skills/pytest-coverage/SKILL.md1Skills CLI (Vercel)
npx skills add github/awesome-copilot --skill pytest-coverage -a claude-code2Manually: put the files in place
~/.claude/skills/pytest-coverage/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/pytest-coverage/
Manually: put the files in place
.agents/skills/pytest-coverage/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/pytest-coverage/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
Platform CLI
gemini skills install https://github.com/github/awesome-copilot --path skills/pytest-coverageManually: put the files in place
.devin/skills/pytest-coverage/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set554
The whole set →Similar
Questions about pytest-coverage
How do I install pytest-coverage in GitHub Copilot?
Run npx skills add github/awesome-copilot --skill pytest-coverage. You can also use gh skill install github/awesome-copilot pytest-coverage.
What does pytest-coverage do?
It runs pytest with coverage, creates annotated source files in cov_annotate, and marks lines not exercised by tests with !.
How do I check coverage for one module?
Run pytest --cov=your_module_name --cov-report=annotate:cov_annotate. For a selected test file, use pytest tests/test_your_module.py --cov=your_module_name --cov-report=annotate:cov_annotate.
Source text
SKILL.md · MIT
--- name: pytest-coverage description: 'Run pytest tests with coverage, discover lines missing coverage, and increase coverage to 100%.' --- 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.
© github · MIT · github/awesome-copilot