From 36c995eef6a63122bdfccf8eb742f330e6041f5a Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Thu, 2 Jul 2020 00:45:55 +0800 Subject: [PATCH] tests: set event_loop fixture to be session scoped fixes https://github.com/lilydjwg/nvchecker/issues/129. --- tests/conftest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index bddf44a..bc8ae02 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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