fix(live/mysql): use pytest_asyncio.fixture(loop_scope=module) on mysql_repo

@pytest.fixture on an async fixture ignores loop_scope, so mysql_repo
ran on the per-function loop while mysql_test_db_url's engine was bound
to the module loop — triggering 'Future attached to a different loop'.
This commit is contained in:
2026-05-10 22:45:05 -04:00
parent e26876ee92
commit ac332a6ba9

View File

@@ -107,7 +107,7 @@ async def mysql_test_db_url():
await admin.dispose() await admin.dispose()
@pytest.fixture @pytest_asyncio.fixture(loop_scope="module")
async def mysql_repo(mysql_test_db_url): async def mysql_repo(mysql_test_db_url):
"""Fresh schema per test — truncate between tests to keep them isolated.""" """Fresh schema per test — truncate between tests to keep them isolated."""
repo = MySQLRepository(url=mysql_test_db_url) repo = MySQLRepository(url=mysql_test_db_url)