From: Ben Darnell Date: Sat, 18 Jan 2020 23:24:03 +0000 (-0500) Subject: test: Use selector event loop on windows. X-Git-Tag: v6.1.0b1~40^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a1adeaa61e61531f8f69a459b098b4ecf147941;p=thirdparty%2Ftornado.git test: Use selector event loop on windows. This gets most of the tests working again on windows with py38. --- diff --git a/tornado/test/__init__.py b/tornado/test/__init__.py index e69de29bb..bfc2656d9 100644 --- a/tornado/test/__init__.py +++ b/tornado/test/__init__.py @@ -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