pytest-coverage

Execute pytest tests with coverage and generate annotated reports of uncovered lines.

1|Updated Feb 23, 2026
One-click install
npx skills add https://github.com/Gabeujin/workspace-init-mcp --skill pytest-coverage-gabeujin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pytest-coverage
Source: https://github.com/Gabeujin/workspace-init-mcp/tree/main/awesome/skills/pytest-coverage
Command: npx skills add https://github.com/Gabeujin/workspace-init-mcp --skill pytest-coverage-gabeujin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pytest, and includes scripts (resource) components.

What problem does it solve?

This Skill addresses the challenge of ensuring comprehensive test coverage for Python code, aiming to identify and fix lines of code not exercised by existing tests.

Core Features & Use Cases

  • Generate Coverage Reports: Creates detailed reports showing which lines of code are covered by tests.
  • Identify Gaps: Highlights specific lines of code that are missing test coverage.
  • Annotated Source Code: Provides an annotated version of source files, marking uncovered lines.
  • Use Case: After writing new features and their corresponding tests, use this Skill to verify that all new code is adequately tested and to pinpoint any regressions or missed test cases.

Quick Start

Run pytest with coverage enabled and generate an annotated report for your module.

Frequently Asked Questions about pytest-coverage

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

FAQPage Schema
How do I measure pytest code coverage and identify uncovered lines in Python?

You can measure pytest code coverage by executing tests with coverage enabled to generate detailed reports and annotated source code, highlighting specific lines missing test coverage in your Python project.

What is the best way to find missing test cases after writing new Python features?

The best way to find missing test cases is to run pytest with coverage measurement to generate annotated reports, pinpointing exact uncovered lines and verifying that all new code is adequately tested.

Do I need to install pytest plugins to generate annotated coverage reports?

Yes, you need the pytest framework and its coverage plugin installed in your Python environment to execute tests while measuring code coverage and generating annotated source reports.

Can I boost my Python project's test coverage to 100% using pytest?

You can boost Python test coverage towards 100% by running pytest with coverage enabled, which identifies uncovered lines through detailed reports so you can write targeted tests for those gaps.

Why does pytest show lines as uncovered when I run code coverage analysis?

Pytest shows lines as uncovered during code coverage analysis when existing tests fail to exercise those specific source code paths, allowing you to identify regressions or missed test cases.