pytest-coverage

Run pytest with coverage and generate annotated reports of untested lines.

1|Updated Mar 9, 2026
One-click install
npx skills add https://github.com/LuminairPrime/openwrt-docs4ai-pipeline --skill pytest-coverage-luminairprime
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pytest-coverage
Source: https://github.com/LuminairPrime/openwrt-docs4ai-pipeline/tree/main/.claude/skills/pytest-coverage
Command: npx skills add https://github.com/LuminairPrime/openwrt-docs4ai-pipeline --skill pytest-coverage-luminairprime

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Pytest-coverage identifies gaps in test coverage by running tests with coverage data and highlighting untested lines, enabling focused improvements.

Core Features & Use Cases

  • Run coverage-enabled test runs to reveal missing branches and hotspots.
  • Generate annotated reports to guide targeted test additions and refactoring.
  • Integrate with CI to enforce coverage goals and prevent regression.

Quick Start

Run a coverage-enabled pytest session to discover untested paths and guide test enhancements.

Frequently Asked Questions about pytest-coverage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I identify untested lines in my pytest suite?

Find untested paths in Python test suites by running pytest with coverage enabled, generating annotated reports that highlight untested lines and missing branches to guide targeted test additions.

What is the best way to improve test coverage for edge cases incrementally?

Improve test coverage incrementally by applying coverage analysis to touched modules, prioritizing edge cases, and guiding the addition of targeted tests to close identified coverage gaps.

How do I generate an annotated coverage report using pytest?

Generate an annotated coverage report by running pytest with coverage enabled, which maps untested lines and hotspots to guide focused test enhancements and code refactoring.

Can I enforce code coverage goals in CI to prevent regression?

Integrate coverage-enabled pytest runs into CI pipelines to enforce coverage goals, prevent regression, and ensure untested lines or missing branches trigger build failures.

Does pytest coverage work for finding missing branches in Python test suites?

Run pytest with coverage to find missing branches by collecting coverage data, revealing untested paths and hotspots in Python modules to guide targeted test improvements.

Why does my pytest coverage report show untested paths after passing tests?

Passing tests do not guarantee all branches are executed; coverage data highlights untested lines and hotspots, revealing gaps that require targeted test additions to achieve full coverage.