mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Try another way
This commit is contained in:
parent
853243caae
commit
17652f038d
1 changed files with 9 additions and 5 deletions
|
|
@ -38,12 +38,9 @@ def pytest_configure(config):
|
||||||
config.addinivalue_line("markers", "redis: marked tests require redis connection to run")
|
config.addinivalue_line("markers", "redis: marked tests require redis connection to run")
|
||||||
config.addinivalue_line("markers", "mongo: marked tests require mongo 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":
|
if sys.platform == "win32":
|
||||||
return asyncio.WindowsSelectorEventLoopPolicy()
|
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
|
||||||
return asyncio.DefaultEventLoopPolicy()
|
return asyncio.set_event_loop_policy(asyncio.DefaultEventLoopPolicy())
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture()
|
@pytest.fixture()
|
||||||
|
|
@ -158,3 +155,10 @@ async def dispatcher():
|
||||||
yield dp
|
yield dp
|
||||||
finally:
|
finally:
|
||||||
await dp.emit_shutdown()
|
await dp.emit_shutdown()
|
||||||
|
|
||||||
|
|
||||||
|
# @pytest.fixture(scope="session")
|
||||||
|
# def event_loop_policy(request):
|
||||||
|
# if sys.platform == "win32":
|
||||||
|
# return asyncio.WindowsSelectorEventLoopPolicy()
|
||||||
|
# return asyncio.DefaultEventLoopPolicy()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue