Skip to main content
skill GitHub Copilot official · GitHub

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.

Install into GitHub Copilot · Skills CLI (Vercel) All methods and platforms ↓
npx skills add github/awesome-copilot --skill pytest-coverage
Open on GitHub

What 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-coverage

2GitHub CLI

gh skill install github/awesome-copilot pytest-coverage

3Manually: put the files in place

.github/skills/pytest-coverage/SKILL.md

From the same set554

The whole set →
git-commit official github This skill reviews Git changes, stages related files, and creates Conventional Commits. Use it when you want an agent to make one commit or split work into separate commits. GitHub Copilot 47,165installs excalidraw-diagram-generator official github Turn a plain-language description into an Excalidraw diagram. Useful for mapping processes, system structure, and relationships between entities. GitHub Copilot 31,639installs multi-stage-dockerfile official github This skill guides GitHub Copilot in writing multi-stage Dockerfiles for different languages and frameworks. Use it when the final runtime image should contain fewer build dependencies. GitHub Copilot 29,688installs documentation-writer official github Skill that turns the agent into a technical writer following the Diátaxis framework: tutorials, how-to guides, reference, and explanation. Proposes structure before writing. GitHub Copilot 27,757installs prd official github Turns a feature idea into a structured PRD with user stories, technical requirements, and risks. Use it when planning a software feature or an AI-powered one. GitHub Copilot 24,035installs refactor official github This skill reshapes existing code without changing its external behavior. Use it for gradual cleanup of large functions, duplication, weak types, and code smells. GitHub Copilot 22,321installs java-springboot official github Gives GitHub Copilot Spring Boot development practices, from project layout to tests and security. Use it when writing or reviewing Java application code. GitHub Copilot 21,272installs create-readme official github This skill reviews a project and creates a structured README.md. Use it when the repository needs clear documentation based on its actual files and code. GitHub Copilot 19,081installs

Similar

better-accessibility jakubkrehel Reviews an interface against WCAG 2.2 and fixes issues in the project’s styling system. Use it to check keyboard navigation and screen-reader behavior. Claude Code CX Codex Cursor +1 29,200installs fastify-best-practices mcollina Guides AI assistants in building Fastify backend servers with TypeScript or JavaScript. It covers plugin encapsulation, schemas, logging, and deployment patterns. Claude Code CX Codex Cursor +1 81,100installs sdf earthtojake This skill authors and validates SDFormat files for models and worlds, then helps prepare them for simulator handoff. Claude Code CX Codex Cursor +1 10,500installs improve-codebase-architecture Matt Pocock This skill scans a codebase for architectural friction, then builds a visual HTML report with refactoring candidates. Use it before a deeper architecture review. Claude Code 1,163,035installs design-taste-frontend Leonxlnx This skill directs the design of public pages and work screens, then checks the result in a browser through screenshots. Use it when an interface feels generic or unfinished. Claude Code CX Codex Cursor +1 673,100installs tdd Matt Pocock Guides the red-green TDD loop: ensures tests are written first, keep them at public interfaces, and avoid coupling to implementation details. Claude Code 1,141,062installs skill-creator official anthropics Creates and refines skills, then tests them with prompts, evaluations, and performance checks. Claude Code Claude.ai 414,180installs agent-browser vercel-labs A CLI skill for browser control: it opens pages, fills forms, clicks buttons, and tests web apps. Use it when an agent needs to act inside a website. Claude Code CX Codex Cursor +1 1,200,000installs

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

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor