From 1bcd02aad2b1d418aa3f1a0d82b4d0a826a00186 Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Thu, 2 Jul 2020 16:10:15 +0800 Subject: [PATCH] tests: session-scoped ioloop is needed for aiohttp support --- tests/conftest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index bddf44a..fe3faed 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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