Generated banner for Pytest Coverage
Generated logo for Pytest Coverage

Pytest Coverage

GitHubOfficialOriginally contributed by @pamelafox as prompts/pytest-coverage.prompt.md; moved into a skill by pull request #761Distributed by GitHub

  • Skill
  • Review and audit
  • Software development
  • MIT
  • No issues found

From the author

Run pytest tests with coverage, discover lines missing coverage, and increase coverage to 100%.
— the description by pamelafox

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a structured approach to improving software reliability by identifying and covering untested code. By utilizing annotated coverage reports, developers can pinpoint exactly which lines of code are not executed during test runs, allowing for targeted test creation to reach full coverage.

What it does

  • Generates annotated coverage reports to visualize test execution paths.
  • Identifies specific lines of code that lack test coverage.
  • Provides commands to run coverage analysis on entire projects or specific modules.
  • Guides the iterative process of adding tests to reach 100% coverage.

When to use it

  • When you need to verify the effectiveness of your existing test suite.
  • When you are tasked with increasing the test coverage of a legacy codebase.
  • When you want to ensure that new features are fully exercised by tests.
  • When you need to identify dead or unreachable code paths.

Advantages

  • Provides clear visual feedback on untested code via annotated files.
  • Supports granular testing by allowing coverage checks on specific modules.
  • Promotes a disciplined, iterative approach to improving software quality.
  • Helps prevent regressions by ensuring critical logic is covered by tests.

Usage examples

“Run a coverage report for my entire project and show me the annotated files.”
The agent executes the pytest coverage command and directs you to the cov_annotate directory to review which lines are missing test coverage.
“How do I check coverage for only the user_auth module?”
The agent provides the specific pytest command using the --cov flag targeted at the user_auth module to generate a focused coverage report.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/github/pytest-coverage/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip pytest-coverage.zip -d .agents/skills

Documentation by pamelafox

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.

Files

ATTRIBUTION.md

Attribution

This folder is an unmodified copy of the Agent Skill "pytest-coverage", distributed by AutoGineer (https://autogineer.com/agent-skills).

The skill's own files are unmodified copies. AutoGineer is not affiliated with or endorsed by the author or the publisher.

Files added by AutoGineer

  • ATTRIBUTION.md: this file, written by AutoGineer

  • LICENSE: copied from LICENSE

Requirements and compatibility

Written for: GitHub Copilot

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Originally contributed by
GitHub avatar of pamelafox@pamelafoxas prompts/pytest-coverage.prompt.mdmoved into a skill by pull request #761
Publisher
GitHub (Official)
Distributed by
GitHub
Source
github/awesome-copilot · skills/pytest-coverage · commit 797337f
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced
Contributors
pamelafox

AutoGineer is not affiliated with or endorsed by pamelafox or GitHub.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download pytest-coverage.zip