Skip to content
Prev Previous commit
Next Next commit
win/tests: Fix a couple of loop.create_connection tests
  • Loading branch information
Yury Selivanov
Yury Selivanov committed Nov 26, 2017
commit 80a5ee00efac4c78c3f161ac22366f07c932265c
11 changes: 7 additions & 4 deletions tests/test_tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@ def test_create_server_4(self):
with sock:
addr = sock.getsockname()

with self.assertRaisesRegex(OSError,
"error while attempting.*\('127.*: "
"address already in use"):
re = r"(error while attempting.*\('127.*: address already in use)"
re += r"|(error while attempting to bind.*only one usage)" # win

with self.assertRaisesRegex(OSError, re):
self.loop.run_until_complete(
self.loop.create_server(object, *addr))

Expand Down Expand Up @@ -467,7 +467,10 @@ async def client():
loop=self.loop)

async def runner():
with self.assertRaisesRegex(OSError, 'Bad file'):
re = r"(Bad file)"
re += r"|(is not a socket)" # win

with self.assertRaisesRegex(OSError, re):
await client()

self.loop.run_until_complete(runner())
Expand Down