testing

testing is a skill for Claude Code from ludo-technologies/python-best-practices. It costs 47 tokens per session (969 once invoked), scanned A, original, MIT.

A guide to writing Python tests with pytest, a framework for running automated tests. It covers test structure, reusable setup, varied test inputs, and replacing external services with controlled test doubles.

In plain words
What is it for?
Use it when writing or reviewing pytest tests, fixtures, parameterized cases, mocks, or conftest.py files.
Why use it?
It helps tests stay readable, focused, and reliable while avoiding accidental dependence on networks, databases, or other outside systems.

Skill for Claude Code

Written for Claude Code: paths in frontmatter.

Good fit Use it when writing or reviewing pytest tests, fixtures, parameterized cases, mocks, or conftest.py files.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ludo-technologies/python-best-practices/testing
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 ludo-technologies/python-best-practices --skill testing
Clone the repo
git clone --depth 1 https://github.com/ludo-technologies/python-best-practices

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 testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/ludo-technologies/python-best-practices/testing/github.svg)](https://agentmods.dev/skills/ludo-technologies/python-best-practices/testing)
Your own site
<a href="https://agentmods.dev/skills/ludo-technologies/python-best-practices/testing"><img src="https://agentmods.dev/badge/skills/ludo-technologies/python-best-practices/testing/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 testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/ludo-technologies/python-best-practices/testing"><img src="https://agentmods.dev/badge/skills/ludo-technologies/python-best-practices/testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 969 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
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.00047 $0.00969
Opus 5.5 $0.00019 $0.00388
Sonnet 5.5 $0.00009 $0.00194
Haiku 4.5 $0.00005 $0.00097

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

Security

Grade A, and why

testing 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.

skills/testing/SKILL.md · 119 lines

How it starts

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

Python Testing

A collection of test-writing best practices for pytest. Designed for AI agents and LLMs to write readable, maintainable, and trustworthy tests.

Categories

Mocking [CRITICAL]

Mock external boundaries only, and keep mocks faithful to real interfaces.

Rule Description
mock-boundaries Mock external boundaries, not internal logic
mock-autospec Use autospec to keep mocks faithful to real signatures
mock-monkeypatch Use monkeypatch for env vars and attributes

Test Structure [HIGH]

Structure tests so failures are easy to diagnose.

Rule Description
struct-aaa-pattern Structure tests as Arrange-Act-Assert
struct-test-naming Name tests after the behavior they verify
struct-one-behavior Test one behavior per test
struct-no-logic Keep conditionals and loops out of tests

Fixtures [HIGH]

Share setup without hiding it.

Rule Description
fixture-scope Use the narrowest fixture scope that works
fixture-conftest Place fixtures in the nearest conftest.py
fixture-factory Use factory fixtures for varied test data

Parametrization [MEDIUM]

Eliminate duplicated tests without hiding cases.

Rule Description
param-parametrize Replace duplicated tests with parametrize
param-ids Give parametrized cases readable ids

Quick Reference

Structure Patterns

def test_expired_token_is_rejected() -> None:
    # Arrange
    token = make_token(expires_at=YESTERDAY)

    # Act
    result = validate(token)

    # Assert
    assert result.valid is False

Read the full file on GitHub · 119 lines

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 · 119 lines · 47 tokens per session scan A 81c321afdaa2

Subscribe to this mod's changes

testing is a skill published in the GitHub repository ludo-technologies/python-best-practices (30 stars, last pushed 1mo ago), licensed MIT. It adds 47 tokens to every session and 969 once invoked, about $0.0002 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-08-30.

Related

Other skills, from other repositories

hypothesis-testing

Property-based testing with Hypothesis for discovering edge cases and validating invariants. Use when implementing comprehensive test coverage, testing complex logic with many inputs, or validating mathematical properties and invariants across input domains. Triggered by: hypothesis, property-based testing, @given…

foryourhealth111-pixel/Vibe-Skills · 62 tokens

test-harness

Generates pytest test suites with happy path, edge cases, error conditions, fixture scaffolding, mocks, async patterns. Triggers on: "generate tests", "write tests for", "test this function", "create test suite", "pytest for", "unit tests for", "mock strategy for".

Mathews-Tom/armory · 65 tokens

python

Use when writing, reviewing, or modernizing Python 3.11+ code. Produces fully type-annotated modules, async I/O, dataclasses and protocols, pytest suites, and a lint/type gate built on ruff and mypy --strict. Trigger on "add type hints to this", "mypy is complaining", "convert this to asyncio", "set up pytest for this…

nimadorostkar/Claude-Skills-collection · 108 tokens

dev-python-quality

Use when Python-specific typing, async behavior, packaging, pytest, ruff/mypy, scripting, or performance quality is central to the request. Do not trigger for generic small code edits merely written in Python.

BlueSkyXN/Codex-is-all-you-need · 46 tokens

python-testing

Python testing strategies using pytest, TDD methodology, fixtures, mocking, parametrization, and coverage requirements.

majiang213/OpenClaw-MAS · 24 tokens

cardputer-buddy

Iterate on the Cardputer-Adv MicroPython app bundle (Claude Buddy, Snake, Hello) after the device is already provisioned via m5-onboard. Use when the user wants to add a new app, push a single changed .py without re-flashing, watch device serial logs, or run a one-shot REPL command. Trigger on "add an app", "push to…

anthropics/claude-plugins-official · 109 tokens