Skip to content

Commit

Permalink
Fix event loop policy handling (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored Nov 28, 2022
1 parent 5915fbb commit 16b3797
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions pytest_jupyter/jupyter_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,12 @@
resource.setrlimit(resource.RLIMIT_NOFILE, (soft, hard))


if os.name == "nt":
asyncio.set_event_loop_policy(
asyncio.WindowsSelectorEventLoopPolicy() # type:ignore[attr-defined]
)


@pytest.fixture
def jp_asyncio_loop():
if os.name == "nt":
asyncio.set_event_loop_policy(
asyncio.WindowsSelectorEventLoopPolicy() # type:ignore[attr-defined]
)
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
yield loop
Expand Down

0 comments on commit 16b3797

Please sign in to comment.