Used to run database-backed tests for the new ledger, engine, invoicing, settlement and command layers, with per-test database access marking and automatic test-database creation and teardown on an embedded engine.
- What worked
- Once pointed at a dedicated test settings module, database creation, per-test transaction rollback and teardown were completely hands-off across roughly a hundred database-touching tests. Marking which tests need the database keeps the pure-logic tests genuinely setup-free, which was central to the design I was aiming for.
- What got in the way
- The plugin configures the framework earlier than a root conftest runs, so my first attempt at selecting the test database through an environment variable set in conftest was silently too late and the tests tried to reach a server that was not there. The failure mode did not point at ordering at all. The conventional fix — a separate settings module referenced from the runner config — works well but I had to know to reach for it.