pytest-coverage

Run pytest tests with coverage, discover lines missing coverage, and increase coverage to 100%.

25 stars

Best use case

pytest-coverage is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Run pytest tests with coverage, discover lines missing coverage, and increase coverage to 100%.

Teams using pytest-coverage should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/pytest-coverage/SKILL.md --create-dirs "https://raw.githubusercontent.com/ComeOnOliver/skillshub/main/skills/github/awesome-copilot/pytest-coverage/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/pytest-coverage/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How pytest-coverage Compares

Feature / Agentpytest-coverageStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Run pytest tests with coverage, discover lines missing coverage, and increase coverage to 100%.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

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

pytest-test-generator

25
from ComeOnOliver/skillshub

Pytest Test Generator - Auto-activating skill for Test Automation. Triggers on: pytest test generator, pytest test generator Part of the Test Automation skill category.

coverage-report-analyzer

25
from ComeOnOliver/skillshub

Coverage Report Analyzer - Auto-activating skill for Test Automation. Triggers on: coverage report analyzer, coverage report analyzer Part of the Test Automation skill category.

Code Coverage with gcov

25
from ComeOnOliver/skillshub

Add gcov code coverage instrumentation to C/C++ projects

Coverage Analysis

25
from ComeOnOliver/skillshub

Coverage analysis is essential for understanding which parts of your code are exercised during fuzzing. It helps identify fuzzing blockers like magic value checks and tracks the effectiveness of harness improvements over time.

../../../engineering-team/playwright-pro/skills/coverage/SKILL.md

25
from ComeOnOliver/skillshub

No description provided.

test-coverage-advisor

25
from ComeOnOliver/skillshub

Reviews test coverage and suggests missing test cases for error paths, edge cases, and business logic. Activates when users write tests or implement new features.

test-coverage-analyzer

25
from ComeOnOliver/skillshub

Analyzes test coverage gaps and suggests test cases for untested code paths. Use when user requests test improvements, coverage analysis, or wants to increase test coverage.

pytest-recording

25
from ComeOnOliver/skillshub

Work with pytest-recording (VCR.py) for recording and replaying HTTP interactions in tests. Use when writing VCR tests, managing cassettes, configuring VCR options, filtering sensitive data, or debugging recorded HTTP responses.

pytest-mock-guide

25
from ComeOnOliver/skillshub

Guide for using pytest-mock plugin to write tests with mocking. Use when writing pytest tests that need mocking, patching, spying, or stubbing. Covers mocker fixture usage, patch methods, spy/stub patterns, and assertion helpers.

coverage-analyzer

25
from ComeOnOliver/skillshub

Advanced coverage analysis with actionable insights. Use to identify coverage gaps, suggest specific tests, track coverage trends, and highlight critical uncovered code. Essential for reaching 80%+ coverage target.

pytest-mastery

25
from ComeOnOliver/skillshub

Python testing with pytest using uv package manager. Use when: (1) Running Python tests, (2) Writing test files or test functions, (3) Setting up fixtures, (4) Parametrizing tests, (5) Generating coverage reports, (6) Testing FastAPI applications, (7) Debugging test failures, (8) Configuring pytest options. Triggers: "run tests", "write tests", "test coverage", "pytest", "unit test", "integration test", "test FastAPI".

tdd-pytest

25
from ComeOnOliver/skillshub

Python/pytest TDD specialist for test-driven development workflows. Use when writing tests, auditing test quality, running pytest, or generating test reports. Integrates with uv and pyproject.toml configuration.