From 17652f038dba3989dc1f360cbefe4a9e1597f60a Mon Sep 17 00:00:00 2001 From: JRoot Junior Date: Sat, 3 Aug 2024 21:40:41 +0300 Subject: [PATCH] Try another way --- tests/conftest.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index d0e7ed69..a61a52b9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -38,12 +38,9 @@ def pytest_configure(config): config.addinivalue_line("markers", "redis: marked tests require redis connection to run") config.addinivalue_line("markers", "mongo: marked tests require mongo connection to run") - -@pytest.fixture(scope="session") -def event_loop_policy(request): if sys.platform == "win32": - return asyncio.WindowsSelectorEventLoopPolicy() - return asyncio.DefaultEventLoopPolicy() + asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) + return asyncio.set_event_loop_policy(asyncio.DefaultEventLoopPolicy()) @pytest.fixture() @@ -158,3 +155,10 @@ async def dispatcher(): yield dp finally: await dp.emit_shutdown() + + +# @pytest.fixture(scope="session") +# def event_loop_policy(request): +# if sys.platform == "win32": +# return asyncio.WindowsSelectorEventLoopPolicy() +# return asyncio.DefaultEventLoopPolicy()