Skip to content

Commit

Permalink
Fix test_create_server_4 with Python 3.12.5+.
Browse files Browse the repository at this point in the history
  • Loading branch information
lschoe committed Aug 21, 2024
1 parent 0305585 commit 20c0951
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/test_tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,14 @@ def test_create_server_4(self):
# "[Errno 10048] error while attempting to bind on address
# ('127.0.0.1', 31098): only one usage of each socket address
# (protocol/network address/port) is normally permitted"
# NB: Python 3.12.5+ adds "[winerror 10048] " before "only one ..."
with self.assertRaisesRegex(OSError,
r"error while attempting.*\('127.*: " +
(r"only one usage of each"
if sys.platform == 'win32'
else r"address( already)? in use")):
r"error while attempting.*\('127.*:" +
(r"( \[errno \d+\])? address"
r"( already)? in use"
if sys.platform != 'win32' else
r"( \[winerror \d+\])? "
r"only one usage of each")):
self.loop.run_until_complete(
self.loop.create_server(object, *addr))

Expand Down

0 comments on commit 20c0951

Please sign in to comment.