mirror of
https://github.com/lilydjwg/nvchecker
synced 2024-12-26 16:42:27 +00:00
tests: set event_loop fixture to be session scoped
fixes https://github.com/lilydjwg/nvchecker/issues/129.
This commit is contained in:
parent
e176078226
commit
36c995eef6
@ -54,10 +54,12 @@ 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.
|
||||
|
||||
The scope is session because the Tornado AsyncHTTPClient singleton remains.
|
||||
"""
|
||||
loop = asyncio.get_event_loop()
|
||||
yield loop
|
||||
|
Loading…
Reference in New Issue
Block a user