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.
npx skills add ludo-technologies/python-best-practices --skill testinggit clone --depth 1 https://github.com/ludo-technologies/python-best-practicesWrote 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.
[](https://agentmods.dev/skills/ludo-technologies/python-best-practices/testing)<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.
<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>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once 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 |
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.
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
What ships with it
16 files 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.
- metadata.json 734 B
- README.md 2.6 KB
- rules/_sections.md 1.6 KB
- rules/_template.md 447 B
- rules/fixture-conftest.md 2.4 KB
- rules/fixture-factory.md 2.4 KB
- rules/fixture-scope.md 2.3 KB
- rules/mock-autospec.md 2.0 KB
- rules/mock-boundaries.md 2.3 KB
- rules/mock-monkeypatch.md 2.3 KB
- rules/param-ids.md 2.1 KB
- rules/param-parametrize.md 2.3 KB
- rules/struct-aaa-pattern.md 1.9 KB
- rules/struct-no-logic.md 2.3 KB
- rules/struct-one-behavior.md 2.0 KB
- rules/struct-test-naming.md 1.7 KB
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.
- 1mo ago First seen · 119 lines · 47 tokens per session scan A 81c321afdaa2
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.
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…
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".
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…
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.
python-testing
Python testing strategies using pytest, TDD methodology, fixtures, mocking, parametrization, and coverage requirements.
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…