tests: session-scoped ioloop is needed for aiohttp support

This commit is contained in:
lilydjwg 2020-07-02 16:10:15 +08:00
parent cbd7e13867
commit 1bcd02aad2
1 changed files with 2 additions and 1 deletions

View File

@ -54,10 +54,11 @@ async def get_version():
return __call__
@pytest.fixture(scope="module")
@pytest.fixture(scope="session")
def event_loop(request):
"""Override pytest-asyncio's event_loop fixture,
Don't create an instance of the default event loop for each test case.
We need the same ioloop across tests for the aiohttp support.
"""
loop = asyncio.get_event_loop()
yield loop