python_test_guide

Guidelines for writing tests for Python code using pytest, a Python testing tool. They cover reviewing code first, adding tests to the appropriate existing file, and checking that new tests pass.

In plain words
What is it for?
Use them when adding or reviewing Python tests, including reusable fixtures, parameterized cases, and mocked dependencies.
Why use it?
They help keep tests focused and prevent blindly testing code that may already contain a bug.

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/flujo-app/mcp-sandbox-computer-vm-for-ai/python_test_guide
Clone the repo
git clone --depth 1 https://github.com/flujo-app/mcp-sandbox-computer-vm-for-ai
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 100% copy Near-identical to another mod 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

This is a copy

100% identical to python_test_guide — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

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 flujo-app/mcp-sandbox-computer-vm-for-ai (3 stars, last pushed 9d 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. It is 100% identical to python_test_guide, differing in 0 lines, and is treated as a copy.