pytest-coverage — скилл для GitHub Copilot: установка
Запускает pytest с покрытием, находит непокрытые строки и предлагает добавить тесты. Нужен, когда цель — довести покрытие кода до 100%.
npx skills add github/awesome-copilot --skill pytest-coverage -a claude-codeЧто делает pytest-coverage
Скилл запускает pytest с параметрами покрытия и создаёт аннотированный отчёт в cov_annotate. Для отдельного модуля можно передать --cov=your_module_name, а для проверки одного файла — путь к тесту.
В cov_annotate создаётся файл для каждого исходника. Строки с символом ! не покрыты тестами: скилл предлагает найти их, дописать тесты и повторять запуск до 100% покрытия строк.
Ставить стоит командам, которые требуют полного покрытия строк. Если вам достаточно общего процента покрытия, такой цикл проверки будет слишком строгим.
Какие задачи решает
- запустить pytest с отчётом о покрытии
- найти строки без тестового покрытия
- проверить покрытие отдельного модуля
- проверить конкретный файл тестов
- довести покрытие строк до 100%
Примеры запросов агенту
- «Запусти pytest с покрытием и создай отчёт в `cov_annotate`».
- «Проверь покрытие `your_module_name` и найди строки с `!`.».
- «Запусти `tests/test_your_module.py` с покрытием для `your_module_name` и добавь недостающие тесты»..
Как установить pytest-coverage
1Через Skills CLI (Vercel)
npx skills add github/awesome-copilot --skill pytest-coverage -a claude-code2Вручную: положить файлы
~/.claude/skills/pytest-coverage/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/pytest-coverage/
Вручную: положить файлы
.agents/skills/pytest-coverage/SKILL.mdДля всех проектов — ~/.agents/skills/
Вручную: положить файлы
.cursor/skills/pytest-coverage/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1Через Skills CLI (Vercel)
npx skills add github/awesome-copilot --skill pytest-coverage2GitHub CLI
gh skill install github/awesome-copilot pytest-coverage3Вручную: положить файлы
.github/skills/pytest-coverage/SKILL.mdКомандой платформы
gemini skills install https://github.com/github/awesome-copilot --path skills/pytest-coverageВручную: положить файлы
.devin/skills/pytest-coverage/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Claude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
Похожие
Вопросы о pytest-coverage
Как установить pytest-coverage в GitHub Copilot?
Выполните npx skills add github/awesome-copilot --skill pytest-coverage. Также доступна команда gh skill install github/awesome-copilot pytest-coverage.
Что делает pytest-coverage?
Скилл запускает тесты pytest с покрытием, создаёт аннотированные исходники в cov_annotate и отмечает непокрытые строки символом !.
Как проверить покрытие одного модуля?
Запустите pytest --cov=your_module_name --cov-report=annotate:cov_annotate. Для отдельного файла тестов используйте pytest tests/test_your_module.py --cov=your_module_name --cov-report=annotate:cov_annotate.
Исходный текст
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