From f200ab7f6040bfc7521c58a737bb4cc3ab4243b2 Mon Sep 17 00:00:00 2001 From: Lendemor Date: Sat, 5 Oct 2024 00:18:29 +0200 Subject: [PATCH] try to set asyncio policy --- tests/units/conftest.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/units/conftest.py b/tests/units/conftest.py index 589d35cd7..2f619a941 100644 --- a/tests/units/conftest.py +++ b/tests/units/conftest.py @@ -1,5 +1,6 @@ """Test fixtures.""" +import asyncio import contextlib import os import platform @@ -24,6 +25,11 @@ from .states import ( ) +def pytest_configure(config): + if config.getoption("asyncio_mode") == "auto": + asyncio.set_event_loop_policy(asyncio.DefaultEventLoopPolicy()) + + @pytest.fixture def app() -> App: """A base app.