Replace SQL-shape mocks only after the database fixture is mandatory

Replace SQL-shape mocks only after the database fixture is mandatory

Tests that assert generated SQL fragments or mocked transaction call order should be replaced by scenarios against a disposable database, but only when that fixture runs in the normal CI path. A skipped integration suite does not preserve coverage: deletion then exchanges weak coverage for no coverage. Consolidate classification, persistence, rollback, locking, and idempotency into a small state-transition matrix, and preserve a browser journey for user-visible ordering. Keep narrow pure tests until equivalent branches are executed by the mandatory fixture.

Applies when: pruning unit tests around database-backed policy and queue logic. Keywords: test pruning database fixture SQL mocks integration coverage CI