fix(ci): catch event loop closed on engine dispose in test teardown

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jason Staack
2026-03-15 06:38:37 -05:00
parent 0c0ca44084
commit 34bb60bd12

View File

@@ -99,7 +99,10 @@ async def admin_engine():
TEST_DATABASE_URL, echo=False, pool_pre_ping=True, pool_size=5, max_overflow=5 TEST_DATABASE_URL, echo=False, pool_pre_ping=True, pool_size=5, max_overflow=5
) )
yield engine yield engine
try:
await engine.dispose() await engine.dispose()
except RuntimeError:
pass # Event loop may be closed during final teardown
@pytest_asyncio.fixture @pytest_asyncio.fixture
@@ -109,7 +112,10 @@ async def app_engine():
TEST_APP_USER_DATABASE_URL, echo=False, pool_pre_ping=True, pool_size=5, max_overflow=5 TEST_APP_USER_DATABASE_URL, echo=False, pool_pre_ping=True, pool_size=5, max_overflow=5
) )
yield engine yield engine
try:
await engine.dispose() await engine.dispose()
except RuntimeError:
pass # Event loop may be closed during final teardown
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------