Skip to content

Commit 80a5ee0

Browse files
committed
win/tests: Fix a couple of loop.create_connection tests
1 parent be83f3d commit 80a5ee0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/test_tcp.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,10 @@ def test_create_server_4(self):
219219
with sock:
220220
addr = sock.getsockname()
221221

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

225+
with self.assertRaisesRegex(OSError, re):
226226
self.loop.run_until_complete(
227227
self.loop.create_server(object, *addr))
228228

@@ -467,7 +467,10 @@ async def client():
467467
loop=self.loop)
468468

469469
async def runner():
470-
with self.assertRaisesRegex(OSError, 'Bad file'):
470+
re = r"(Bad file)"
471+
re += r"|(is not a socket)" # win
472+
473+
with self.assertRaisesRegex(OSError, re):
471474
await client()
472475

473476
self.loop.run_until_complete(runner())

0 commit comments

Comments
 (0)