RUL-002 — No mocking — real infra, real implementations only
Ruling
No unittest.mock, no Mock/MagicMock/AsyncMock/patch, no hand-rolled Fake/Stub/Dummy classes, no monkeypatch, no @pytest.mark.skip/skipif. Tests run against real Redis/Neo4j/gateway/kernel. The only sanctioned test double is the LLM boundary (swap client.call_llm / inject _call_llm=fn).
Evidence
- Global CLAUDE.md engineering standard + project Hard Rules (
AGENTS.md) both state this as non-negotiable; user memoryuser-mohamed: "strict parallel test isolation (no mocks/stubs/skips/monkeypatch — real infra only)". .claude/hooks/no-doubles-py.sh(PreToolUse Write/Edit guard) and.claude/hooks/forbidden-doubles-stop.sh(Stop-hook reminder) both exist specifically because the pattern kept recurring.
Enforcement
- gate scripts/test-review.py T1
- gate scripts/audit_test_purity.py monkeypatch
- codetools-hook no-doubles-py
Verification
scripts/test-review.py rule T1 ("No mocking") flags unittest.mock imports and Mock/MagicMock/AsyncMock/patch/mocker usage; scripts/audit_test_purity.py scans for the monkeypatch pattern class (plus Fake/Stub/skip) and exits non-zero on any hit; codetools hook no-doubles-py (wired in claude/project-hooks.json; formerly .claude/hooks/no-doubles-py.sh) refuses a Write/Edit that introduces a double.