diff --git a/tests/sessionloop/conftest.py b/tests/loop_fixture_scope/conftest.py similarity index 64% rename from tests/sessionloop/conftest.py rename to tests/loop_fixture_scope/conftest.py index bb6c1d6c..223160c2 100644 --- a/tests/sessionloop/conftest.py +++ b/tests/loop_fixture_scope/conftest.py @@ -3,14 +3,14 @@ import pytest -class CustomSelectorLoopSession(asyncio.SelectorEventLoop): +class CustomSelectorLoop(asyncio.SelectorEventLoop): """A subclass with no overrides, just to test for presence.""" -loop = CustomSelectorLoopSession() +loop = CustomSelectorLoop() -@pytest.fixture(scope="package") +@pytest.fixture(scope="module") def event_loop(): """Create an instance of the default event loop for each test case.""" yield loop diff --git a/tests/sessionloop/test_session_loops.py b/tests/loop_fixture_scope/test_loop_fixture_scope.py similarity index 79% rename from tests/sessionloop/test_session_loops.py rename to tests/loop_fixture_scope/test_loop_fixture_scope.py index acb67165..679ab48f 100644 --- a/tests/sessionloop/test_session_loops.py +++ b/tests/loop_fixture_scope/test_loop_fixture_scope.py @@ -1,4 +1,4 @@ -"""Unit tests for overriding the event loop with a session scoped one.""" +"""Unit tests for overriding the event loop with a larger scoped one.""" import asyncio import pytest @@ -8,7 +8,7 @@ async def test_for_custom_loop(): """This test should be executed using the custom loop.""" await asyncio.sleep(0.01) - assert type(asyncio.get_event_loop()).__name__ == "CustomSelectorLoopSession" + assert type(asyncio.get_event_loop()).__name__ == "CustomSelectorLoop" @pytest.mark.asyncio