Fix test on MacOS

This commit is contained in:
Unrud 2020-02-20 10:42:50 +01:00
parent d3b632e123
commit 363dd79833

View File

@ -123,7 +123,8 @@ class TestBaseServerRequests(BaseTest):
with pytest.raises(OSError) as exc_info: with pytest.raises(OSError) as exc_info:
sock.bind((address, 0)) sock.bind((address, 0))
assert (isinstance(exc_info.value, socket.gaierror) and assert (isinstance(exc_info.value, socket.gaierror) and
exc_info.value.errno == server.COMPAT_EAI_ADDRFAMILY or exc_info.value.errno in (socket.EAI_NONAME,
server.COMPAT_EAI_ADDRFAMILY) or
# Workaround for PyPy # Workaround for PyPy
str(exc_info.value) == "address family mismatched") str(exc_info.value) == "address family mismatched")