win/tests: Use IOCP asyncio loop on Windows

This commit is contained in:
Yury Selivanov 2016-11-23 19:34:08 -05:00
parent 6d8636cbe8
commit 5bc48b3dfe
1 changed files with 5 additions and 1 deletions

View File

@ -306,7 +306,11 @@ class AIOTestCase(BaseTestCase):
super().tearDown()
def new_loop(self):
return asyncio.new_event_loop()
if hasattr(asyncio, 'ProactorEventLoop'):
# On Windows try to use IOCP event loop.
return asyncio.ProactorEventLoop()
else:
return asyncio.new_event_loop()
def has_IPv6():