Skip to content

Commit

Permalink
fix test regexes for musl libc
Browse files Browse the repository at this point in the history
  • Loading branch information
tornaria committed Jan 4, 2024
1 parent e317d9c commit 282c00c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/trio/_tests/test_fakenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

# ENOTCONN gives different messages on different platforms
if sys.platform == "linux":
ENOTCONN_MSG = r"^\[Errno 107\] Transport endpoint is not connected$"
ENOTCONN_MSG = r"^\[Errno 107\] (Transport endpoint is|Socket) not connected$"
elif sys.platform == "darwin":
ENOTCONN_MSG = r"^\[Errno 57\] Socket is not connected$"
else:
Expand Down Expand Up @@ -41,7 +41,7 @@ async def test_basic_udp() -> None:

# Cannot bind multiple sockets to the same address
with pytest.raises(
OSError, match=r"^\[\w+ \d+\] (Address already in use|Unknown error)$"
OSError, match=r"^\[\w+ \d+\] (Address (already )?in use|Unknown error)$"
) as exc:
await s2.bind(("127.0.0.1", port))
assert exc.value.errno == errno.EADDRINUSE
Expand Down
2 changes: 1 addition & 1 deletion src/trio/_tests/test_highlevel_open_tcp_listeners.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ async def test_open_tcp_listeners_rebind() -> None:
probe.setsockopt(stdlib_socket.SOL_SOCKET, stdlib_socket.SO_REUSEADDR, 1)
with pytest.raises(
OSError,
match="(Address already in use|An attempt was made to access a socket in a way forbidden by its access permissions)$",
match="(Address (already )?in use|An attempt was made to access a socket in a way forbidden by its access permissions)$",
):
probe.bind(sockaddr1)

Expand Down

0 comments on commit 282c00c

Please sign in to comment.