Python Testing Patterns

Python Testing Patterns is a skill for Claude Code, Codex from niels-emmer/myace. It costs 24 tokens per session (325 once invoked), scanned A, original, MIT.

A collection of Python testing practices for clear, isolated, and repeatable tests. It covers fixtures, test doubles, asynchronous code, and flaky-test diagnosis.

In plain words
What is it for?
Use it when adding tests, fixing unreliable tests, choosing mocks or fakes, or checking normal, boundary, and failure cases.
Why use it?
It reduces tests that depend on network access, time, random values, shared state, or execution order, so failures point to real behaviour changes.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for aider. Also seen: mentions Codex; built for aider; mentions OpenCode.

Good fit Use it when adding tests, fixing unreliable tests, choosing mocks or fakes, or checking normal, boundary, and failure cases.

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

Made for: Claude Code, Codex.

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 Python Testing Patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/niels-emmer/myace/python-testing-patterns/github.svg)](https://agentmods.dev/skills/niels-emmer/myace/python-testing-patterns)
Your own site
<a href="https://agentmods.dev/skills/niels-emmer/myace/python-testing-patterns"><img src="https://agentmods.dev/badge/skills/niels-emmer/myace/python-testing-patterns/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 Python Testing Patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/niels-emmer/myace/python-testing-patterns"><img src="https://agentmods.dev/badge/skills/niels-emmer/myace/python-testing-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 325 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.00024 $0.00325
Opus 5.5 $0.00010 $0.00130
Sonnet 5.5 $0.00005 $0.00065
Haiku 4.5 $0.00002 $0.00032

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

Security

Grade A, and why

Python Testing Patterns 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 today.

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.

collections/additional/python-developer/skills/python-testing-patterns/SKILL.md · 30 lines

What it actually says

Purpose

Keep tests fast, deterministic and meaningful so a failure points at a real defect.

When to use it

When adding tests, fixing flaky ones, or reviewing a change whose tests mock too much.

Checklist

  • Structure: arrange, act, assert; one behaviour per test; names that state the behaviour.
  • Fixtures: small fixtures with the narrowest scope that works; no hidden ordering between tests.
  • Parametrise instead of copy-pasted cases; include the boundary and failure cases.
  • Isolation: no real network, clock or randomness; inject or patch them. Use tmp_path for files.
  • Mocks: mock at the boundary you own (the HTTP client, the repository), not the function under test; prefer fakes over deep patch chains.
  • Async: use the project's async pytest plugin consistently; await everything.
  • Flaky tests are blocking: find the cause (shared state, time, ordering); do not add retries or sleeps.

Expected output

A test suite that is deterministic, runs quickly, and fails only when behaviour changes.

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. today First seen · 30 lines · 24 tokens per session scan A baedbe2a2f37

Subscribe to this mod's changes

Python Testing Patterns is a skill published in the GitHub repository niels-emmer/myace (1 stars, last pushed yesterday), licensed MIT. It adds 24 tokens to every session and 325 once invoked, about $0.0001 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-11-29.

Related

Python Testing Patterns compared with skills from other repositories

Python Testing Patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
Python Testing Patternsniels-emmer/myaceSkill1yesterdayMITA24Claude Code, Codex
test-generatorvstorm-co/pydantic-deepagentsSkill1.1ktodayMITA12Claude Code, Codex
test-harnessMathews-Tom/armorySkill3455d agoMITA65Claude Code
loom-pythoncosmix/loomSkill66todayMITA14Claude Code, Codex
loom-ccosmix/loomSkill66todayMITA25Claude Code, Codex
python-test-writerbeel-collab/presets.devSkill37d agoMITA48Claude Code, Codex
idiomatic-goTypeFox/agent-skillsSkill51mo agoMITA137Claude Code