Skip to content

Commit d5a0f47

Browse files
simonfagerholmTinche
authored andcommitted
Enable test_subprocess to be run on win, by changing to ProactorEventLoop in those tests.
1 parent d07cd2d commit d5a0f47

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/test_subprocess.py

+11
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@
66
import pytest
77

88

9+
if sys.platform == 'win32':
10+
# The default asyncio event loop implementation on Windows does not
11+
# support subprocesses. Subprocesses are available for Windows if a
12+
# ProactorEventLoop is used.
13+
@pytest.yield_fixture()
14+
def event_loop():
15+
loop = asyncio.ProactorEventLoop()
16+
yield loop
17+
loop.close()
18+
19+
920
@pytest.mark.asyncio(forbid_global_loop=False)
1021
async def test_subprocess(event_loop):
1122
"""Starting a subprocess should be possible."""

0 commit comments

Comments
 (0)