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.
git clone --depth 1 https://github.com/nedcodes-ok/cursor-doctorWrote 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/rules/nedcodes-ok/cursor-doctor/pytest)<a href="https://agentmods.dev/rules/nedcodes-ok/cursor-doctor/pytest"><img src="https://agentmods.dev/badge/rules/nedcodes-ok/cursor-doctor/pytest/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/rules/nedcodes-ok/cursor-doctor/pytest"><img src="https://agentmods.dev/badge/rules/nedcodes-ok/cursor-doctor/pytest.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.00529 | $0.00529 |
| Opus 5.5 | $0.00212 | $0.00212 |
| Sonnet 5.5 | $0.00106 | $0.00106 |
| Haiku 4.5 | $0.00053 | $0.00053 |
Grade A, and why
pytest 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.
This is a copy
100% identical to pytest — 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.
How it starts
The opening of the file, as written. The whole thing — 47 lines — stays where its author put it; the contents beside it link to each section on GitHub.
pytest Cursor Rules
You are an expert in pytest testing. Follow these rules:
Structure
- Name test files test_*.py or test.py. Name test functions test
- Group related tests in classes (class TestUserAuth:) — no init needed
- Use descriptive names: test_login_fails_with_expired_token over test_login_3
- One assertion concept per test — multiple asserts are fine if testing one behavior
Fixtures
- Define fixtures in conftest.py for shared setup — pytest discovers them automatically
- Use @pytest.fixture with appropriate scope: function (default), class, module, session
- Yield fixtures for setup/teardown: yield resource then cleanup after
- Use factory fixtures (fixture that returns a factory function) for parameterized setup
- Request fixtures by name in test parameters — no imports needed
Parametrize
- Use @pytest.mark.parametrize("input,expected", [...]) for data-driven tests
- Use ids parameter for readable test names: ids=["empty", "single", "overflow"]
- Stack multiple parametrize decorators for combinatorial testing
- Use pytest.param(..., marks=pytest.mark.xfail) for expected failures in param sets
Markers
- Use @pytest.mark.slow, @pytest.mark.integration — register in pytest.ini/pyproject.toml
- Run subsets with -m "not slow" or -m integration
- Use @pytest.mark.skipif(condition, reason="...") over bare skip
- Use @pytest.mark.usefixtures("db") when you need the fixture but not its value
Assertions & Patterns
- Use plain assert — pytest rewrites them for detailed failure output
- Use pytest.raises(ExceptionType, match="pattern") as context manager
- Use pytest.approx() for float comparisons: assert result == pytest.approx(3.14, abs=1e-2)
- Use tmp_path fixture for temp files, monkeypatch for env vars and attributes
Configuration
- Configure in pyproject.toml [tool.pytest.ini_options] — not pytest.ini or setup.cfg
- Set testpaths, markers, addopts (e.g., -ra --strict-markers)
- Use --strict-markers to catch typos in marker names
- Use conftest.py at project root for shared fixtures, in subdirs for scoped ones
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 · 47 lines · 529 tokens per session scan A b4e15391035b
pytest is a cursor rule published in the GitHub repository nedcodes-ok/cursor-doctor (10 stars, last pushed 7mo ago), licensed MIT. It adds 529 tokens to every session, about $0.0021 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to pytest, differing in 0 lines, and is treated as a copy.
Other cursor rules, from other repositories
pytest
You are an expert in pytest testing. Follow these rules.
python-testing
Testing standards — auto-attached to test files.
python-cursorrules-prompt-file-best-practices
Cursor rules for Python development with best practices integration.
python-general-coding-standards
A set of general standards for Python projects, including type hints, input checking, code style, security, web requests, background work, and tests. It also covers FastAPI-specific tasks such as CORS and authentication.
python
Python development guidelines — PEP 8, type hints, error handling, async patterns, packaging, and testing. Applied when working with Python code.
cursorrules
You are building an AI/ML project with Python. The project uses PyTorch for model training, handles data pipelines with proper validation, tracks experiments systematically, and follows production ML engineering practices. Code is type-hinted, tested, and reproducible.