Skip to content

Commit 16b3797

Browse files
authored
Fix event loop policy handling (#27)
1 parent 5915fbb commit 16b3797

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

pytest_jupyter/jupyter_core.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,12 @@
3333
resource.setrlimit(resource.RLIMIT_NOFILE, (soft, hard))
3434

3535

36-
if os.name == "nt":
37-
asyncio.set_event_loop_policy(
38-
asyncio.WindowsSelectorEventLoopPolicy() # type:ignore[attr-defined]
39-
)
40-
41-
4236
@pytest.fixture
4337
def jp_asyncio_loop():
38+
if os.name == "nt":
39+
asyncio.set_event_loop_policy(
40+
asyncio.WindowsSelectorEventLoopPolicy() # type:ignore[attr-defined]
41+
)
4442
loop = asyncio.new_event_loop()
4543
asyncio.set_event_loop(loop)
4644
yield loop

0 commit comments

Comments
 (0)