← ClaudeAtlas

flat-test-persistencelisted

Use when testing a flat-layered service's data-access package against the real datastore — its tables and the repository class that owns its transactions — pinning the generated constraint name where the translator branches on it, the catalogue exception a driver error is translated into on each write and read the class has, what each read returns, and each write's conditional contract where it has one — an upsert's update set from both sides, an ordering-stamp guard where writes for one key can arrive out of order, an empty update set, a batch's chunk edge and same-key inputs, a paged read's tied edge, a multi-statement write's atomicity. Consumes the container and isolation fixtures rather than laying them (`flat-test-integration-setup`). Not the function a trigger calls that reaches this write path, which is `flat-test-entrypoint`, and not a hexagonal `IFooRepository` adapter, which is `hex-test-repository-contract`, in the `pyhouse-hex` plugin.
wntic/pyhouse · ★ 3 · AI & Automation · score 76
Install: claude install-skill wntic/pyhouse
# Flat Test — Data-Access Contract Consult `test-principles` for the testing constitution. Where this skill contradicts `test-principles`, the constitution wins. One integration-test file per repository class, under the distribution's own `tests/integration/`, driven against the **real** datastore from `flat-test-integration-setup`. This is the only level that can catch what the data-access package exists to guarantee: that a conflict updates the columns it claims to, that a read returns what the store holds, and that a driver error arrives as the service's own exception. Where several distributions share one data-access library, the files sit with that library's own tests instead — `myschema/tests/integration/` — and nothing else changes. **The isolation fixture follows the declared transaction owner** (`test-principles` reliability rule 2): `connection` for every assertion query and for a callable that accepts a connection; the `engine` fixture handed to the repository class's constructor, with `truncate_all` cleaning up, for one that opens its own — asserting through a fresh connection only where its own rollback is under test (rule 10). ## When to use vs. neighbours - A pure function in the data-access package — a connection-string builder, the row mapper → not this skill; it is a unit test with no fixtures at all. - The container, migration and isolation fixtures themselves → `flat-test-integration-setup`; this skill consumes `connection`, `engine` and `truncat