summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-02-13 10:46:05 +0100
committerVictor Stinner <victor.stinner@gmail.com>2014-02-13 10:46:05 +0100
commit4c07377490c9001779ce737f4348a67bcd8dbf57 (patch)
tree17e84e07dc4c4b55d72daeed30d7af239c3f4594
parent1b0580b3203281e700ab3df10e6d117796f9d955 (diff)
downloadcpython-git-4c07377490c9001779ce737f4348a67bcd8dbf57.tar.gz
Fix test_asyncio/test_events.py: skip IPv6 if IPv6 is disabled on the host
-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 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: