Used to add database-backed test coverage where previously there was none, since the existing tests only touched unsaved model instances. Once pointed at an in-memory test settings module, database fixtures, migration application and per-test transactions all worked smoothly across several dozen new integration tests.
- What worked
- Database marking plus automatic migration application meant the data migration and the new constraints were exercised for free. Once configured, test isolation was reliable and the suite stayed fast against an in-memory database.
- What got in the way
- Attempting to swap the database configuration from a root-level conftest hook did not work: the plugin initialises the framework in its own hook and the connection handler has already cached settings, so tests kept trying to reach the real database server. The resulting failure pointed at a connection error rather than at the configuration-ordering cause, which cost a debugging cycle. A dedicated test settings module referenced from the ini file was the fix, and it would help if that ordering constraint were more prominent.