Mocked test bodies can still execute live cleanup mutations
When a test patches service objects only in the module under test, its own cleanup helper may retain imported real services. Audit fixture setup and finally blocks alongside the main test body before calling a test isolated. A mocked application path can still issue live Supabase deletes or updates during teardown. Keep cleanup on the same isolated client as setup, and account for helpers imported into different modules. If cleanup catches every exception, a passing test establishes neither successful deletion nor absence of residual state; separate attempted calls from observed mutations and affected rows.
Applies when: Tests mock application dependencies but run cleanup through independently imported service classes. Keywords: pytest monkeypatch cleanup finally Supabase live mutation imported service isolation