testing

testing is a cursor rule for Cursor from SecondLifes/code-intel. It costs 854 tokens per session, scanned A, original, Apache-2.0.

A project-specific testing rule for a Python codebase that uses pytest, a tool for running automated tests. It separates ordinary tests from manual tests that require hardware or external services such as a GPU, Ollama, or Qdrant.

In plain words
What is it for?
Use it when adding, organizing, or naming tests, and when deciding whether a test belongs in tests/ or tests/manual/.
Why use it?
It keeps the default test run usable on a basic checkout while documenting which tests need special equipment or running services.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when adding, organizing, or naming tests, and when deciding whether a test belongs in tests/ or tests/manual/.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/secondlifes/code-intel/testing
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.

Clone the repo
git clone --depth 1 https://github.com/SecondLifes/code-intel

Made for: Cursor.

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

agentmods badge for testing

README.md
[![agentmods](https://agentmods.dev/badge/rules/secondlifes/code-intel/testing/github.svg)](https://agentmods.dev/rules/secondlifes/code-intel/testing)
Your own site
<a href="https://agentmods.dev/rules/secondlifes/code-intel/testing"><img src="https://agentmods.dev/badge/rules/secondlifes/code-intel/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.

agentmods 80×15 button for testing

Your own site · 80×15
<a href="https://agentmods.dev/rules/secondlifes/code-intel/testing"><img src="https://agentmods.dev/badge/rules/secondlifes/code-intel/testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 854 This file is loaded in full into every session.
When invoked 854 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00854 $0.00854
Opus 5.5 $0.00342 $0.00342
Sonnet 5.5 $0.00171 $0.00171
Haiku 4.5 $0.00085 $0.00085

Measured 1mo ago against content hash 213b14cfd505, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

.cursor/rules/testing.mdc · 88 lines

How it starts

The opening of the file, as written. The whole thing — 88 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Testing — Rules

pytest is the only test framework. Everything below is the real, observed discipline of this repository, verified against pytest.ini and the actual suite — not generic advice.

The two-tier split (non-negotiable)

tests/            ← default `pytest` run — NO real external services
tests/manual/     ← needs a real GPU / Ollama / Qdrant — EXCLUDED from the default run

pytest.ini enforces this:

[pytest]
testpaths = tests
norecursedirs = tests/manual .venv .git __pycache__
  • A test that needs a running Qdrant, a loaded Ollama model, or actual GPU hardware belongs in tests/manual/ — putting it in tests/ breaks the default run for everyone who doesn't have that hardware up.
  • Conversely, a test that needs nothing external belongs in tests/, where it actually runs. Don't park a self-contained test in tests/manual/ where nobody executes it.
  • tests/manual/ is run explicitly and individually when the hardware and services are available — it is never expected to pass in a bare checkout.

Naming — the name states the locked-in behavior

test_<behavior_under_test>, not test_<function_name>. The name should say what regression it prevents:

# Good — the real convention (tests/test_chunker.py)
def test_line_shift_does_not_change_chunk_id(tmp_path):
    """KRİTİK regresyon: bir chunk'ın ÜSTÜNE satır eklemek, içeriği aynı kalan
    chunk'ların ID'sini DEĞİŞTİRMEMELİ (satır no ID'ye katılmıyor olmalı)."""

# Weak — names the function, not the behavior
def test_chunk_file():

Docstrings in tests follow the codebase-wide convention: Turkish, and they state why the test exists (which bug it locks out), not what the code does.

Self-contained fixtures, no external files

Tests build their own inputs — tmp_path plus inline source snippets defined as module-level constants in the test file itself (see tests/test_chunker.py's OVERLOADED_CLASS). A test in tests/ must not depend on a path outside the repo, a network call, a pre-existing Qdrant collection, or a model download.

Read the full file on GitHub · 88 lines

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. 1mo ago First seen · 88 lines · 854 tokens per session scan A 213b14cfd505

Subscribe to this mod's changes

testing is a cursor rule published in the GitHub repository SecondLifes/code-intel (2 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 854 tokens to every session, about $0.0034 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-31.