testing-python

testing-python is a skill for Claude Code, Codex from TheBeardedBearSAS/claude-craft. It costs 28 tokens per session (543 once invoked), scanned A, original, MIT.

A testing strategy for Python 3.14 and common Python web projects. It covers unit, integration, browser, mutation, property-based, formatting, and type-checking work.

In plain words
What is it for?
Use it when writing or reviewing Python tests, setting coverage rules, checking types, enforcing formatting, or testing browser flows.
Why use it?
It helps you choose a consistent test setup and catch bugs in both program behaviour and code quality.

Skill for Claude CodeCodex

Part of the claude-craft plugin — 56 skills, 94 commands, 47 agents, 5 hooks shipped together

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/thebeardedbearsas/claude-craft/testing-python
Any agent
npx skills add TheBeardedBearSAS/claude-craft --skill testing-python
Clone the repo
git clone --depth 1 https://github.com/TheBeardedBearSAS/claude-craft

Made for: Claude Code, Codex.

Or install claude-craft, the plugin that ships this one along with the rest of its 56 skills, 94 commands, 47 agents, 5 hooks.

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-python

README.md
[![agentmods](https://agentmods.dev/badge/skills/thebeardedbearsas/claude-craft/testing-python.svg)](https://agentmods.dev/skills/thebeardedbearsas/claude-craft/testing-python)
Your own site
<a href="https://agentmods.dev/skills/thebeardedbearsas/claude-craft/testing-python"><img src="https://agentmods.dev/badge/skills/thebeardedbearsas/claude-craft/testing-python.svg" alt="Measured on agentmods" 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 543 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.00028 $0.00543
Opus 5 $0.00014 $0.00271
Sonnet 5 $0.00006 $0.00109
Haiku 4.5 $0.00003 $0.00054

Measured yesterday against content hash 98539115a2be, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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

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-python/SKILL.md · 46 lines

What it actually says

Stratégie de Tests Python 3.14+

Versions : Python 3.14+ | pytest 8.x | Ruff 0.8+ | mypy 1.13+ | Playwright

Ruff remplace Black + isort + Flake8 (10-100x plus rapide). mypy strict élimine les bugs de type à la compilation.

Stack recommandée 2026

Type Outil Usage
Unit/Integration pytest 8.x Tests backend FastAPI/Django
Linting + Format Ruff 0.8+ 10-100× plus rapide que Black+Flake8
Type checking mypy 1.13+ strict Vérification statique
E2E/Browser Playwright Tests frontend web
Mutation Mutmut Qualité des tests (score >= 80%)
Property-based Hypothesis Génération de cas de test automatique

Sources : pytest, Ruff, Mutmut

Invariants non-négociables

  • Couverture >= 80% (--cov-fail-under=80 dans pyproject.toml)
  • mypy strict — zéro Any non justifié, disallow_untyped_defs = true
  • Ruff obligatoire (check + format) dans CI
  • Pattern AAA (Arrange-Act-Assert) dans chaque test
  • Fixtures pytest pour l'injection de dépendances (pas d'état global)
  • Mutation score >= 80% via Mutmut

Checklist par type

Type Vérification
Unit Isolation totale, fixtures pytest, mocks unittest.mock
Integration TestClient FastAPI / Client Django, DB de test
E2E Playwright sync_api, expect() assertions
Property Hypothesis @given pour edge cases automatiques
Mutation mutmut run, score >= 80 avant merge

Détails complets, exemples de code, configs et checklists : voir REFERENCE.md

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. yesterday First seen · 46 lines · 28 tokens per session scan A 98539115a2be

Subscribe to this mod's changes

testing-python is a skill published in the GitHub repository TheBeardedBearSAS/claude-craft (105 stars, last pushed 2d ago), licensed MIT. It adds 28 tokens to every session and 543 once invoked, about $0.0001 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-09-03.