diff --git a/tests/test_rbac_comprehensive.py b/tests/test_rbac_comprehensive.py index d79f48d..d66f42c 100644 --- a/tests/test_rbac_comprehensive.py +++ b/tests/test_rbac_comprehensive.py @@ -1200,6 +1200,11 @@ async def mail_app(engine: AsyncEngine, redis_client): await session.commit() yield app await close_engine() + # Suite isolation: close_engine() disposed AND nulled all global engines, + # which broke every downstream suite with 'relation users does not exist'. + # Restore the conftest engine as the global engine so downstream suites + # keep working (mirrors the production bootstrap). + reset_engine_for_testing(engine) @pytest_asyncio.fixture