pytest-coverage

Run pytest with coverage to produce per-file reports and annotated missing lines.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/PoyoPoak/FastAPI-App-Template --skill pytest-coverage-poyopoak
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pytest-coverage
Source: https://github.com/PoyoPoak/FastAPI-App-Template/tree/main/.agents/skills/pytest-coverage
Command: npx skills add https://github.com/PoyoPoak/FastAPI-App-Template --skill pytest-coverage-poyopoak

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Ensures Python projects achieve higher test coverage by guiding users through running tests with coverage, discovering untested lines, and improving test suites.

Core Features & Use Cases

  • Generate a coverage report with pytest --cov and an annotated view (cov_annotate) to locate missing lines.
  • Inspect coverage per module or file and iteratively add tests to reach comprehensive coverage.
  • Use cov_annotate outputs to prioritize test improvements during refactors or feature additions.

Quick Start

Run the pytest coverage workflow to identify untested lines and start adding tests that cover them.

Frequently Asked Questions about pytest-coverage

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

FAQPage Schema
How do I find untested lines in my Python project using pytest coverage?

Pytest coverage identifies untested lines by running pytest with coverage to produce per-file reports and an annotated view of missing lines. You can inspect coverage per module to locate gaps and iteratively add tests to reach comprehensive coverage.

What is cov_annotate and how does it help with Python code coverage?

Cov_annotate generates an annotated view of missing lines in your Python modules. It produces artifacts that guide test expansion by highlighting specific untested code blocks across the project, helping you prioritize test improvements during refactors.

Do I need pytest-cov integration to identify missing test coverage?

Yes, pytest-cov integration is required to run the coverage workflow and generate the per-file reports. You also need cov_annotate-generated artifacts present in your project to guide targeted test expansion and achieve near-100% coverage.

How do I boost my pytest test coverage to 100 percent?

To boost pytest coverage to 100 percent, run the coverage workflow to identify untested lines, inspect the annotated outputs to locate missing code blocks, and iteratively add tests targeting those specific gaps across your Python modules.

Can I use this coverage approach to prioritize test improvements during refactoring?

Yes, you can use cov_annotate outputs to prioritize test improvements during refactors or feature additions. The annotated view shows exactly which lines lack coverage, allowing you to target untested code blocks efficiently.

What are the limitations of using pytest coverage annotations for test expansion?

The approach requires cov_annotate-generated artifacts to be present and depends on pytest-cov integration. It targets untested code blocks based on line coverage data, so achieving near-100% coverage requires iterative manual test additions guided by the reports.