testing

A testing guide for Python projects using pytest, a tool for running automated tests. It focuses on tests that check observable behavior without contacting real services.

In plain words
What is it for?
Use it when adding behavior, fixing bugs, reviewing test coverage, or changing the test suite; use fakes or mocks for outside systems.
Why use it?
It keeps tests fast and repeatable and avoids failures, costs, or data changes caused by live language models, databases, APIs, or MCP servers.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/extra-org/extra/testing
Any agent
npx skills add extra-org/extra --skill testing
Clone the repo
git clone --depth 1 https://github.com/extra-org/extra

Made for: Claude Code, Codex.

Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,144 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00034 $0.01144
Opus 5 $0.00017 $0.00572
Sonnet 5 $0.00007 $0.00229
Haiku 4.5 $0.00003 $0.00114

Measured 2d ago against content hash 30d38b3f8142, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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.

.claude/skills/testing/SKILL.md · 121 lines

How it starts

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

Skill: Testing

Purpose

Define how to write and run tests for this Python project so that every meaningful behavior is covered by fast, deterministic, behavior-focused tests that never touch real external systems.

When to Use This Skill

  • Adding or changing any behavior (tests accompany behavior — almost always).
  • Fixing a bug (add a regression test first).
  • Working on the test suite or quality gate (task 0012).
  • Reviewing whether a change is adequately tested.

Files to Read First

  • AGENTS.md
  • docs/DEVELOPMENT_WORKFLOW.md
  • pyproject.toml ([tool.pytest.ini_options])
  • The skill for the area under test (runtime, prompts, plugins, tools, etc.).

Core Principles

  • Use pytest. Tests live under tests/, mirroring src/agentplatform/.
  • Test behavior through public interfaces, not private implementation details (test internals only when there is no public seam).
  • No real external systems in unit tests: never call real LLMs, real MCP servers, real databases, or third-party APIs. Mock/fake them.
  • Integration tests only when explicitly requested, and still without real secrets or live third-party calls — use fakes/local stand-ins.
  • Deterministic: control time, randomness, and ordering.
  • Regression tests for bugs: every fixed bug gets a test that fails before the fix.

Process

  1. Pick the category (see below) for what you are testing.
  2. Arrange with fixtures for repeated setup (specs, compiled graphs, fake resolver/access plugins, fake tools). Use @pytest.mark.parametrize for input variations.
  3. Mock external boundaries (LLM/MCP/DB/HTTP) at the adapter seam, not deep inside.
  4. Write behavior assertions: given input, assert observable output/effects.
  5. Cover negatives and security: invalid YAML/validation errors, missing required prompt variables, denied protected-node access, plugin errors.
  6. Run make test (and make check for the full gate). Fix failures.

Read the full file on GitHub · 121 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. 2d ago First seen · 121 lines · 34 tokens per session scan A 30d38b3f8142

Subscribe to this mod's changes

testing is a skill published in the GitHub repository extra-org/extra (108 stars, last pushed 4d ago), licensed MIT. It adds 34 tokens to every session and 1,144 once invoked, about $0.0002 per session on Opus 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.