From ac332a6ba907190a89a321a25585e3e09e7b9f0c Mon Sep 17 00:00:00 2001 From: anti Date: Sun, 10 May 2026 22:45:05 -0400 Subject: [PATCH] fix(live/mysql): use pytest_asyncio.fixture(loop_scope=module) on mysql_repo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @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'. --- tests/live/test_mysql_backend_live.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/live/test_mysql_backend_live.py b/tests/live/test_mysql_backend_live.py index e6baa0b8..fac18d8a 100644 --- a/tests/live/test_mysql_backend_live.py +++ b/tests/live/test_mysql_backend_live.py @@ -107,7 +107,7 @@ async def mysql_test_db_url(): await admin.dispose() -@pytest.fixture +@pytest_asyncio.fixture(loop_scope="module") async def mysql_repo(mysql_test_db_url): """Fresh schema per test — truncate between tests to keep them isolated.""" repo = MySQLRepository(url=mysql_test_db_url)