← ClaudeAtlas

test_authoringlisted

Principles for stringent pytest tests — tests a realistic bug turns red. Pair with a granted stack-infra testing skill (test_authoring_sqlite / test_authoring_pg / a fork-local one) if the shell has one.
jedbjorn/subfloor · ★ 14 · Testing & QA · score 76
Install: claude install-skill jedbjorn/subfloor
# test_authoring — stringent pytest tests Apply when writing a test or reviewing a diff that touches `tests/`. Pass condition for any test: a realistic bug turns it red. A test no bug can fail reads as coverage while guarding nothing — sharpen or cut it. Stack infra (fixture setup, callers, DB access pattern) lives in the granted stack skill — `test_authoring_sqlite` / `test_authoring_pg` / a fork-local skill that supersedes this one. Load it alongside. None granted -> this skill stands alone; do NOT hunt for one the fork doesn't ship. ## Rules (the floor) 1. **Count + content + negative.** After a count assertion (`written == 1`), assert the content (the right row: fields + FKs) + the negative (the row that must NOT exist). Wrong body / wrong participant / stray contact must turn the test red. `>= 1` is banned where the exact count is knowable. 2. **No config-mirror tautologies.** NEVER assert output equals a constant the code under test imports in-process (`assert resp == list(THE_SAME_CONSTANT)`) — it catches hardcoding only, never a wrong value. Pin the literal expectation in the test, or derive it from independent behavior (e.g. the error classes a real `classify_error()` emits across sample failures). 3. **Round-trips assert the negative space.** Insert `new` -> assert `new` present + prior value gone + sibling fields untouched. `assert get() == put_value` alone passes against a stub that echoes input. 4. **Every error / edge branch