1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-08-01 18:18:31 +00:00

Fix test on MacOS (3)

This commit is contained in:
Unrud 2020-02-20 11:27:26 +01:00
parent ee984b49d4
commit f46a3e3d24
2 changed files with 6 additions and 2 deletions

View file

@ -126,11 +126,12 @@ class TestBaseServerRequests(BaseTest):
socket.IPV6_V6ONLY, 1)
with pytest.raises(OSError) as exc_info:
sock.bind((address, 0))
# See ``radicale.server.serve``
assert (isinstance(exc_info.value, socket.gaierror) and
exc_info.value.errno in (socket.EAI_NONAME,
server.COMPAT_EAI_ADDRFAMILY) or
# Workaround for PyPy
str(exc_info.value) == "address family mismatched")
str(exc_info.value) == "address family mismatched" or
exc_info.value.errno == errno.EADDRNOTAVAIL)
def test_ipv6(self):
with socket.socket(socket.AF_INET6, socket.SOCK_STREAM) as sock: