Skip to content

Commit f673cfd

Browse files
authored
Merge pull request #2917 from tornaria/test-musl
fix test regexes for musl libc
2 parents eb32952 + 282c00c commit f673cfd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/trio/_tests/test_fakenet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

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

4242
# Cannot bind multiple sockets to the same address
4343
with pytest.raises(
44-
OSError, match=r"^\[\w+ \d+\] (Address already in use|Unknown error)$"
44+
OSError, match=r"^\[\w+ \d+\] (Address (already )?in use|Unknown error)$"
4545
) as exc:
4646
await s2.bind(("127.0.0.1", port))
4747
assert exc.value.errno == errno.EADDRINUSE

src/trio/_tests/test_highlevel_open_tcp_listeners.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ async def test_open_tcp_listeners_rebind() -> None:
9494
probe.setsockopt(stdlib_socket.SOL_SOCKET, stdlib_socket.SO_REUSEADDR, 1)
9595
with pytest.raises(
9696
OSError,
97-
match="(Address already in use|An attempt was made to access a socket in a way forbidden by its access permissions)$",
97+
match="(Address (already )?in use|An attempt was made to access a socket in a way forbidden by its access permissions)$",
9898
):
9999
probe.bind(sockaddr1)
100100

0 commit comments

Comments
 (0)