Use SelectorEventLoop on Python 3.8 + Windows
MODIFY
appveyor.yml
appveyor.yml
@@ -27,6 +27,11 @@ environment:
PYTHON_ARCH: "64"
NOX_SESSION: "test-3.7"
+ - PYTHON: "C:\\Python38-x64"
+ PYTHON_VERSION: "3.8.x"
+ PYTHON_ARCH: "64"
+ NOX_SESSION: "test-3.8"
+
cache:
- C:\Users\appveyor\AppData\Local\pip\Cache

MODIFY
test/conftest.py
test/conftest.py
+import platform
+import sys
+
import pytest
import trustme
@@ -10,6 +13,15 @@ from dummyserver.server import (
)
+# The Python 3.8+ default loop on Windows breaks Tornado
+@pytest.fixture(scope="session", autouse=True)
+def configure_windows_event_loop():
+ if sys.version_info >= (3, 8) and platform.system() == "Windows":
+ import asyncio
+
+ asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
+
+
@pytest.fixture(scope="session")
def certs_dir(tmp_path_factory):
tmpdir = tmp_path_factory.mktemp("certs")

Use SelectorEventLoop on Python 3.8 + Windows (#1777)