pytest-coverage

pytest-coverage is a command for GitHub Copilot from saajunaid/caddis-plugin. It costs 11 tokens per session (487 once invoked), scanned A, original, MIT.

A command that examines pytest coverage and adds tests to reach full code coverage. Pytest is a Python tool for running tests; coverage shows which code those tests exercise.

In plain words
What is it for?
It is for reviewing Python test coverage and adding tests for code that existing tests do not cover.
Why use it?
It helps identify untested code and reduces the manual work of filling testing gaps.

Command for GitHub Copilot

Written for GitHub Copilot: a Copilot chat mode or prompt.

Good fit It is for reviewing Python test coverage and adding tests for code that existing tests do not cover.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/saajunaid/caddis-plugin/pytest-coverage
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/saajunaid/caddis-plugin

Made for: GitHub Copilot.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pytest-coverage

README.md
[![agentmods](https://agentmods.dev/badge/commands/saajunaid/caddis-plugin/pytest-coverage/github.svg)](https://agentmods.dev/commands/saajunaid/caddis-plugin/pytest-coverage)
Your own site
<a href="https://agentmods.dev/commands/saajunaid/caddis-plugin/pytest-coverage"><img src="https://agentmods.dev/badge/commands/saajunaid/caddis-plugin/pytest-coverage/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pytest-coverage

Your own site · 80×15
<a href="https://agentmods.dev/commands/saajunaid/caddis-plugin/pytest-coverage"><img src="https://agentmods.dev/badge/commands/saajunaid/caddis-plugin/pytest-coverage.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 487 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00011 $0.00487
Opus 5.5 $0.00004 $0.00195
Sonnet 5.5 $0.00002 $0.00097
Haiku 4.5 $0.00001 $0.00049

Measured 1mo ago against content hash ca93e57564cf, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pytest-coverage scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/prompts/pytest-coverage.prompt.md · 67 lines

What it actually says

Pytest Coverage Improvement

Run pytest with coverage analysis and iteratively add tests until all lines are covered.

Instructions

Step 1: Generate Coverage Report

Run pytest with annotated coverage output:

pytest --cov --cov-report=annotate:cov_annotate

To scope to a specific module:

pytest --cov=<module_name> --cov-report=annotate:cov_annotate

To run specific test files:

pytest tests/test_<module>.py --cov=<module_name> --cov-report=annotate:cov_annotate

Step 2: Identify Uncovered Lines

Open the cov_annotate/ directory. Each source file has a corresponding annotated file:

  • Lines starting with ! (exclamation mark) are not covered by tests.
  • Files with 100% coverage can be skipped.

Step 3: Add Missing Tests

For each file with less than 100% coverage:

  1. Open the annotated file and identify all !-marked lines.
  2. Determine what test cases would exercise those code paths:
    • Conditional branches (if/elif/else)
    • Exception handlers (try/except)
    • Edge cases (empty inputs, None values, boundary conditions)
    • Error paths (invalid arguments, missing data)
  3. Write focused tests that specifically target the uncovered lines.
  4. Follow existing test conventions in the project (fixtures, naming, structure).

Step 4: Verify and Iterate

Re-run the coverage command after adding tests. Repeat steps 2-3 until all lines are covered.

Step 5: Clean Up

After reaching target coverage:

  • Remove the cov_annotate/ directory (or add it to .gitignore)
  • Ensure all new tests pass independently: pytest tests/ -v

Tips

  • Prefer testing behavior over implementation details.
  • Use pytest.raises() to cover exception paths.
  • Use @pytest.mark.parametrize to cover multiple branches concisely.
  • Mock external dependencies (database, APIs) to test error-handling paths.
  • If a line is genuinely unreachable, mark it with # pragma: no cover.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 67 lines · 11 tokens per session scan A ca93e57564cf

Subscribe to this mod's changes

pytest-coverage is a command published in the GitHub repository saajunaid/caddis-plugin (0 stars, last pushed today), licensed MIT. It adds 11 tokens to every session and 487 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-09.