]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
test: Use selector event loop on windows.
authorBen Darnell <ben@bendarnell.com>
Sat, 18 Jan 2020 23:24:03 +0000 (18:24 -0500)
committerBen Darnell <ben@bendarnell.com>
Sun, 19 Jan 2020 22:07:16 +0000 (17:07 -0500)
This gets most of the tests working again on windows with py38.

tornado/test/__init__.py

index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..bfc2656d9f67cdc1f75e280148cc04fbb9a780b3 100644 (file)
@@ -0,0 +1,8 @@
+import asyncio
+import sys
+
+# Use the selector event loop on windows. Do this in tornado/test/__init__.py
+# instead of runtests.py so it happens no matter how the test is run (such as
+# through editor integrations).
+if sys.platform == "win32" and hasattr(asyncio, "WindowsSelectorEventLoopPolicy"):
+    asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())  # type: ignore