diff --git a/qualification/conftest.py b/qualification/conftest.py index fd907df25..d7f8b9c1b 100644 --- a/qualification/conftest.py +++ b/qualification/conftest.py @@ -28,6 +28,7 @@ import matplotlib.style import pytest +import pytest_asyncio import pytest_check from katsdpservices import get_interface_address @@ -176,14 +177,10 @@ def key(item: pytest.Item) -> tuple: return tuple(ans) items.sort(key=key) - - -# Need to redefine this from pytest-asyncio to have it at session scope -@pytest.fixture(scope="session") -def event_loop(): # noqa: D103 - loop = asyncio.get_event_loop_policy().new_event_loop() - yield loop - loop.close() + scope_marker = pytest.mark.asyncio(loop_scope="session") + for item in items: + if pytest_asyncio.is_async_test(item): + item.add_marker(scope_marker, append=False) @pytest.fixture(scope="package")