pytest-coverage
github/awesome-copilot
Run pytest with coverage analysis and incrementally increase test coverage to 100%.
What is pytest-coverage?
This skill runs pytest with coverage reporting to identify untested code lines. It generates annotated source files showing which lines lack test coverage, helping you systematically add tests until achieving 100% coverage.
- Generate coverage reports with pytest and annotated source output
- Identify uncovered lines marked with ! in annotated files
- Focus coverage analysis on specific modules or test files
- Review annotated source code to find gaps in test coverage
- Track progress toward 100% code coverage
How to install pytest-coverage
npx skills add https://github.com/github/awesome-copilot --skill pytest-coverage- pytest installed
- pytest-cov plugin installed
- Python project with existing tests
How to use pytest-coverage
- 1.Run pytest with coverage: pytest --cov --cov-report=annotate:cov_annotate (or specify a module with --cov=module_name)
- 2.Open the generated cov_annotate directory to view annotated source files
- 3.Review files with less than 100% coverage; skip files showing 100%
- 4.Look for lines starting with ! (exclamation mark) indicating uncovered code
- 5.Write additional tests to cover the marked lines
- 6.Re-run the coverage command to verify improvement
- 7.Repeat until all files show 100% coverage
Use cases
- Improve test coverage for a Python module from 80% to 100%
- Identify which lines in a critical function are not being tested
- Generate a coverage report before merging a pull request
- Discover edge cases and error paths that lack test coverage
- Ensure all production code is exercised by the test suite
- Python developers writing unit tests
- QA engineers verifying test completeness
- Teams with coverage requirements or standards
- Developers refactoring code and needing coverage validation
pytest-coverage FAQ
Use pytest --cov=your_module_name --cov-report=annotate:cov_annotate to generate coverage only for that module.
Specify the test file path: pytest tests/test_your_module.py --cov=your_module_name --cov-report=annotate:cov_annotate
A line starting with ! is not covered by any test. You need to add tests that execute that line.
No. Files showing 100% coverage mean all lines are already tested, so you can skip them and focus on files with gaps.
Full instructions (SKILL.md)
Source of truth, from github/awesome-copilot.
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.
Related skills
More from github/awesome-copilot and the wider catalog.

python-mcp-server-generator
Generate a complete, production-ready MCP server in Python with tools, resources, and proper configuration.

python-pypi-package-builder
End-to-end skill for building, testing, linting, versioning, and publishing a production-grade Python library to PyPI. Covers all four build backends (setuptools+setuptools_scm, hatchling, flit, poetry), PEP 440 versioning, semantic versioning, dynamic git-tag versioning, OOP/SOLID design, type hints (PEP 484/526/544/561), Trusted Publishing (OIDC), and the full PyPA packaging flow. Use for: creating Python packages, pip-installable SDKs, CLI tools, framework plugins, pyproject.toml setup, py.typed, setuptools_scm, semver, mypy, pre-commit, GitHub Actions CI/CD, or PyPI publishing.

quality-playbook
Complete quality engineering audit: behavioral requirements, spec-traced tests, three-pass review, multi-model spec audit, and TDD-verified patches.

quasi-coder
Turns shorthand, pseudo-code, and rough natural-language descriptions into production-quality code.

react-audit-grep-patterns
Provides the complete, verified grep scan command library for auditing React codebases before a React 18.3.1 or React 19 upgrade. Use this skill whenever running a migration audit - for both the react18-auditor and react19-auditor agents. Contains every grep pattern needed to find deprecated APIs, removed APIs, unsafe lifecycle methods, batching vulnerabilities, test file issues, dependency conflicts, and React 19 specific removals. Always use this skill when writing audit scan commands - do not rely on memory for grep syntax, especially for the multi-line async setState patterns which require context flags.

react18-batching-patterns
Provides exact patterns for diagnosing and fixing automatic batching regressions in React 18 class components. Use this skill whenever a class component has multiple setState calls in an async method, inside setTimeout, inside a Promise .then() or .catch(), or in a native event handler. Use it before writing any flushSync call - the decision tree here prevents unnecessary flushSync overuse. Also use this skill when fixing test failures caused by intermediate state assertions that break after React 18 upgrade.