python_test_guide

A guide for writing tests for Python code using pytest, a tool for running automated Python tests. It also covers reviewing the code before adding tests and mocking external behavior.

In plain words
What is it for?
Use it when adding or updating Python tests, choosing an existing test file, checking suspected bugs, and running the resulting test suite.
Why use it?
It provides a consistent testing process and helps avoid writing tests that merely assume the existing code is correct.

Agent

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 agents/kiln-ai/kilntainers/python_test_guide
Clone the repo
git clone --depth 1 https://github.com/Kiln-AI/Kilntainers
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 231 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.00000 $0.00231
Opus 5 $0.00000 $0.00115
Sonnet 5 $0.00000 $0.00046
Haiku 4.5 $0.00000 $0.00023

Measured 2d ago against content hash 8b8d8d3ef19d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

agents/python_test_guide.md · 12 lines

What it actually says

Python Test Guide

When writing tests for Python code:

  1. Always use pytest for tests in Python code
  2. Before writing tests, do a code review to check for potential issues in the code. Don't blindly write tests assuming the code works properly. If you believe there may be a bug but are uncertain, ask the user. If you're reasonably certain there is a bug, write a test showing it, confirm it fails, then ask the user if you were correct and if they want you to fix the issue.
  3. Assume an appropriate test file already exists, find it, and append tests to that file. Don't create new test files unless you've confirmed an appropriate one does not exist.
  4. Test brevity is important. Use approaches for re-use and brevity including using pytest fixtures for repeated code, and using pytest parametrize for similar tests.
  5. Use unittest.mock, unittest.mock.patch and related test tools
  6. After writing a new test, run it and ensure it works. Fix any issues you find.

test are type checked, but using # type: ignore[...] comments is acceptable, only in test files.

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 · 12 lines · 0 tokens per session scan A 8b8d8d3ef19d

Subscribe to this mod's changes

python_test_guide is an agent published in the GitHub repository Kiln-AI/Kilntainers (50 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 231 tokens. 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 agents, from other repositories

agent-request-queue

一次 Agent 运行可能包含多次模型调用、知识库检索、工具执行和文件操作。为了避免同一对话同时修改同一份上下文,Yuxi 把“收到请求”和“开始运行”分成两个阶段,并为每个线程维护 FIFO 队列。.

xerrors/Yuxi · 0 tokens

frontend-engineer

Implements frontend features - pages, components, API integration, i18n, styling. Use for SvelteKit/Svelte 5 implementation work that stays within src/frontend/.

fpindej/netrock · 39 tokens

browser-tester-v2

Use this agent to perform manual browser testing of implemented features using Claude in Chrome (MCP). Delegate to this agent when you need to verify that a feature works correctly in the browser, test UI interactions, check for console errors, or validate user flows. Provide context about what was implemented and…

lipas-liikuntapaikat/lipas · 69 tokens

web-frontend

Expert frontend developer for React, Vue, Angular, CSS, accessibility, and modern web technologies.

hoangsonww/AI-Agents-Orchestrator · 22 tokens

devops-engineer

Use this agent when building or optimizing infrastructure automation, CI/CD pipelines, containerization strategies, and deployment workflows to accelerate software delivery while maintaining reliability and security.

piomin/claude-ai-spring-boot · 36 tokens

security-engineer

Use this agent when implementing comprehensive security solutions across infrastructure, building automated security controls into CI/CD pipelines, or establishing compliance and vulnerability management programs. Invoke for threat modeling, zero-trust architecture design, security automation implementation, and…

piomin/claude-ai-spring-boot · 55 tokens