Skip to content

Commit 21f3313

Browse files
committed
Skip IPv6 test if the system does not support IPv6
Signed-off-by: Russell Bryant <[email protected]>
1 parent 543430b commit 21f3313

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/test_utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,13 @@ def test_split_zmq_path_invalid(invalid_path):
694694

695695

696696
def test_make_zmq_socket_ipv6():
697+
# Check if IPv6 is supported by trying to create an IPv6 socket
698+
try:
699+
sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
700+
sock.close()
701+
except socket.error:
702+
pytest.skip("IPv6 is not supported on this system")
703+
697704
ctx = zmq.Context()
698705
ipv6_path = "tcp://[::1]:5555" # IPv6 loopback address
699706
socket_type = zmq.REP # Example socket type

0 commit comments

Comments
 (0)