mirror of
https://github.com/lilydjwg/nvchecker.git
synced 2025-03-10 06:14:02 +00:00
tests: session-scoped ioloop is needed for aiohttp support
This commit is contained in:
parent
cbd7e13867
commit
1bcd02aad2
1 changed files with 2 additions and 1 deletions
|
@ -54,10 +54,11 @@ async def get_version():
|
||||||
|
|
||||||
return __call__
|
return __call__
|
||||||
|
|
||||||
@pytest.fixture(scope="module")
|
@pytest.fixture(scope="session")
|
||||||
def event_loop(request):
|
def event_loop(request):
|
||||||
"""Override pytest-asyncio's event_loop fixture,
|
"""Override pytest-asyncio's event_loop fixture,
|
||||||
Don't create an instance of the default event loop for each test case.
|
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()
|
loop = asyncio.get_event_loop()
|
||||||
yield loop
|
yield loop
|
||||||
|
|
Loading…
Add table
Reference in a new issue