summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-02-13 09:46:05 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-02-13 09:46:05 (GMT)
commit1ff0ee0be2e5e0a1a961d042d47e13febbb1ce0e (patch)
tree16724c1df9bf6e63a6b07274267b79f1dbb80e29 /Lib/test/test_asyncio
parent422794767bbd91f3807a483c7862189b2acc0c60 (diff)
downloadcpython-1ff0ee0be2e5e0a1a961d042d47e13febbb1ce0e.zip
cpython-1ff0ee0be2e5e0a1a961d042d47e13febbb1ce0e.tar.gz
cpython-1ff0ee0be2e5e0a1a961d042d47e13febbb1ce0e.tar.bz2
Fix test_asyncio/test_events.py: skip IPv6 if IPv6 is disabled on the host
Diffstat (limited to 'Lib/test/test_asyncio')
-rw-r--r--Lib/test/test_asyncio/test_events.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py
index 4300ddd..3bb8dd8 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: