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 agentmods add rules/iloveitaly/llm-ide-rules/pytest-integration-testsgit clone --depth 1 https://github.com/iloveitaly/llm-ide-rulesWrote 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/iloveitaly/llm-ide-rules/pytest-integration-tests)<a href="https://agentmods.dev/rules/iloveitaly/llm-ide-rules/pytest-integration-tests"><img src="https://agentmods.dev/badge/rules/iloveitaly/llm-ide-rules/pytest-integration-tests.svg" alt="Measured on agentmods" 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.00000 | $0.01310 |
| Opus 5 | $0.00000 | $0.00655 |
| Sonnet 5 | $0.00000 | $0.00262 |
| Haiku 4.5 | $0.00000 | $0.00131 |
Grade A, and why
pytest-integration-tests 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 6d 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 — 110 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Pytest Integration Tests
- Look to
app/factories/to generate any required database state- Here's an example of how to create + persist a factory
DistributionFactory.save(domain=PYTHON_TEST_SERVER_HOST)
- Here's an example of how to create + persist a factory
- Add the
serverfactory to each test - Use the
fakerfactory to generate emails, etc. - Don't add obvious
assertdescriptions - Do not use the
db_sessionfixture here. Instead, usewith test_session():if you need to setup complex database state - if a UI timeout is occuring, it could be because it cannot find a element because the rendering has changed. Check the failure screenshot and see if you can correct the test assertion.
- The integration tests can take a very long time to run. Do not abort them if they are taking a long time.
- Use
expect(page.get_by_text("Screening is fully booked")).to_be_visible()instead ofexpect(page.get_by_role("heading")).to_contain_text("Screening is fully booked"). It's less brittle. - Do not use
clientfixtures in an integration test. Integration tests should only use the frontend of the website to interact with the application, not the API. - Use
with page.expect_response("https://example.com/resource") as response_info:to assert against network activity. - Do not
next_button.evaluate("el => el.click()")instead, justlocator.click(). If this doesn't work, stop your work and let me know. - Only use
wait_for_loading(page)if aLONG_INTEGRATION_TEST_TIMEOUTon an expectation does not work:expect(page.get_by_text("Your Matched Doctors")).to_be_visible(timeout=LONG_INTEGRATION_TEST_TIMEOUT)LONG_INTEGRATION_TEST_TIMEOUTshould only be used as a last resort. If you have many of these in a test, let me know and I will debug it.
- Prefer fewer integration tests that cover more functionality. Unlike unit tests, where each test is designed to test a very particular piece of functionality, I want integration tests to cover entire workflows. It's preferred to add more steps to an integration test to test an entire workflow.
- Prefer simple locators. If a
filter,or_, etc is required to capture a button in multiple states it indicates something is wrong in the code. - Use
react_router_urlto generate the frontend url path and do not setbase_url. - End all Playwright tests with
from pytest_playwright_artifacts import assert_no_console_errorsandassert_no_console_errors(request)(capture is the plugin'splaywright_console_loggingfixture).- Test-Specific Ignores: Pass
ignore=[...]toassert_no_console_errorsperpytest-playwright-artifacts(regex strings, compiled patterns, or{"file": "...", "message": "..."}dicts); add a comment explaining why. - Global Ignores: Use
playwright_console_ignoreunder[tool.pytest.ini_options]inpyproject.toml(seepytest-playwright-artifactsREADME).
- Test-Specific Ignores: Pass
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.
- 6d ago First seen · 110 lines · 0 tokens per session scan A fcb9d4555e90
pytest-integration-tests is a cursor rule published in the GitHub repository iloveitaly/llm-ide-rules (13 stars, last pushed 5d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,310 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.
Other cursor rules, from other repositories
ai-kb
Use shared AI KB rules and context.
read-xlsx
Reading, writing, diffing, and repairing spreadsheets (.xlsx) for AI agents via the xfa MCP server.
cdv
How to drive the cdv MCP sidecar (observe, verify, remember, resume).
pn-tool-risk-policy
MCP tool risk tiers, HITL gates, and when to use approvalcheckpoint and gatelogappend. Use for safety reviews and workflow audits.
004_auto_context
Rules for requesting relevant memory context based on file types, locations, and current activity.
core
Rails 8 Core Principles Guide.