pytest

pytest is a skill for Claude Code from bobmatnyc/claude-mpm-skills. It costs 28 tokens per session (8,363 once invoked), scanned A, original, MIT.

A Python tool for writing and running automated tests. Tests are small checks that verify whether code behaves as expected.

In plain words
What is it for?
It helps test Python code, FastAPI, Django, and Flask applications, including asynchronous code and repeated test cases.
Why use it?
It makes failures easier to find and supports testing from individual functions to larger web applications.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

not rated 74repo 1mo ago A scan Socket: passSnyk: passSkillSpector: warn 28 tokens original MIT

Good fit It helps test Python code, FastAPI, Django, and Flask applications, including asynchronous code and repeated test cases.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bobmatnyc/claude-mpm-skills/pytest
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.

Any agent
npx skills add bobmatnyc/claude-mpm-skills --skill pytest
Clone the repo
git clone --depth 1 https://github.com/bobmatnyc/claude-mpm-skills

Made for: Claude Code.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/bobmatnyc/claude-mpm-skills/pytest/github.svg)](https://agentmods.dev/skills/bobmatnyc/claude-mpm-skills/pytest)
Your own site
<a href="https://agentmods.dev/skills/bobmatnyc/claude-mpm-skills/pytest"><img src="https://agentmods.dev/badge/skills/bobmatnyc/claude-mpm-skills/pytest/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

Your own site · 80×15
<a href="https://agentmods.dev/skills/bobmatnyc/claude-mpm-skills/pytest"><img src="https://agentmods.dev/badge/skills/bobmatnyc/claude-mpm-skills/pytest.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 8,363 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 16 Apr 2026
  • Snyk pass 16 Apr 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Data Exfiltration · line 721
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
  • medium Data Exfiltration · line 880
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
How audits are shown
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.00028 $0.08363
Opus 5 $0.00014 $0.04182
Sonnet 5 $0.00006 $0.01673
Haiku 4.5 $0.00003 $0.00836

Measured 7d ago against content hash 189d7e1a9a0c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

pytest scanned grade A with 1 finding 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 7d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

response = requests.get(f"https://api.example.com/users/{user_id}")
toolchains/python/testing/pytest/SKILL.md · 1,463 lines

How it starts

The opening of the file, as written. The whole thing — 1,463 lines — stays where its author put it; the contents beside it link to each section on GitHub.

pytest - Professional Python Testing

Overview

pytest is the industry-standard Python testing framework, offering powerful features like fixtures, parametrization, markers, plugins, and seamless integration with FastAPI, Django, and Flask. It provides a simple, scalable approach to testing from unit tests to complex integration scenarios.

Key Features:

  • Fixture system for dependency injection
  • Parametrization for data-driven tests
  • Rich assertion introspection (no need for self.assertEqual)
  • Plugin ecosystem (pytest-cov, pytest-asyncio, pytest-mock, pytest-django)
  • Async/await support
  • Parallel test execution with pytest-xdist
  • Test discovery and organization
  • Detailed failure reporting

Installation:

# Basic pytest
pip install pytest

# With common plugins
pip install pytest pytest-cov pytest-asyncio pytest-mock

# For FastAPI testing
pip install pytest httpx pytest-asyncio

# For Django testing
pip install pytest pytest-django

# For async databases
pip install pytest-asyncio aiosqlite

Basic Testing Patterns

1. Simple Test Functions

# test_math.py
def add(a, b):
    return a + b

def test_add():
    assert add(2, 3) == 5
    assert add(-1, 1) == 0
    assert add(0, 0) == 0

def test_add_negative():
    assert add(-2, -3) == -5

Run tests:

# Discover and run all tests
pytest

# Verbose output
pytest -v

# Show print statements
pytest -s

# Run specific test file
pytest test_math.py

# Run specific test function
pytest test_math.py::test_add

2. Test Classes for Organization

# test_calculator.py
class Calculator:
    def add(self, a, b):
        return a + b

    def multiply(self, a, b):
        return a * b

class TestCalculator:
    def test_add(self):
        calc = Calculator()
        assert calc.add(2, 3) == 5

    def test_multiply(self):
        calc = Calculator()
        assert calc.multiply(4, 5) == 20

    def test_add_negative(self):
        calc = Calculator()
        assert calc.add(-1, -1) == -2

Read the full file on GitHub · 1,463 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 7d ago First seen · 1,463 lines · 28 tokens per session scan A 189d7e1a9a0c

Subscribe to this mod's changes

pytest is a skill published in the GitHub repository bobmatnyc/claude-mpm-skills (74 stars, last pushed 1mo ago), licensed MIT. It adds 28 tokens to every session and 8,363 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.