From: Victor Stinner Date: Thu, 13 Feb 2014 09:46:05 +0000 (+0100) Subject: Fix test_asyncio/test_events.py: skip IPv6 if IPv6 is disabled on the host X-Git-Tag: v3.4.0rc2~57 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4c07377490c9001779ce737f4348a67bcd8dbf57;p=python Fix test_asyncio/test_events.py: skip IPv6 if IPv6 is disabled on the host --- diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py index 4300ddd0ff..3bb8dd810a 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -1192,8 +1192,12 @@ class EventLoopTestsMixin: 'selector': self.loop._selector.__class__.__name__}) def test_sock_connect_address(self): + families = [socket.AF_INET] + if support.IPV6_ENABLED: + families.append(socket.AF_INET6) + address = ('www.python.org', 80) - for family in (socket.AF_INET, socket.AF_INET6): + for family in families: for sock_type in (socket.SOCK_STREAM, socket.SOCK_DGRAM): sock = socket.socket(family, sock_type) with sock: