Skip to content

Commit c8a52a0

Browse files
committed
[refactor] Tests for "loop_fixture_scope" create the custom event loop inside the event_loop fixture override rather than on the module-level.
This prevents the custom loop from being created during test collection time. Signed-off-by: Michael Seifert <[email protected]>
1 parent b9bed8b commit c8a52a0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

tests/loop_fixture_scope/conftest.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ class CustomSelectorLoop(asyncio.SelectorEventLoop):
77
"""A subclass with no overrides, just to test for presence."""
88

99

10-
loop = CustomSelectorLoop()
11-
12-
1310
@pytest.fixture(scope="module")
1411
def event_loop():
1512
"""Create an instance of the default event loop for each test case."""
13+
loop = CustomSelectorLoop()
1614
yield loop
1715
loop.close()

0 commit comments

Comments
 (0)