Skip to content

Commit 277a4e9

Browse files
committed
Use asyncio.WindowsSelectorEventLoopPolicy() for applicable tests
https://twistedmatrix.com/trac/ticket/9766
1 parent 08bc017 commit 277a4e9

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

testing/conftest.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,20 @@
1+
import sys
2+
3+
import pytest
4+
5+
16
pytest_plugins = "_pytest.pytester"
7+
8+
9+
@pytest.hookimpl(tryfirst=True)
10+
def pytest_configure(config):
11+
if (
12+
config.getoption("reactor") == 'asyncio'
13+
and sys.platform == 'win32'
14+
and sys.version_info >= (3, 8)
15+
):
16+
# https://twistedmatrix.com/trac/ticket/9766
17+
import asyncio
18+
19+
selector_policy = asyncio.WindowsSelectorEventLoopPolicy()
20+
asyncio.set_event_loop_policy(selector_policy)

0 commit comments

Comments
 (0)