asyncio: ops, and now fix also the unit test for IPv6 address:
authorVictor Stinner <victor.stinner@gmail.com>
Thu, 20 Feb 2014 16:01:11 +0000 (17:01 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Thu, 20 Feb 2014 16:01:11 +0000 (17:01 +0100)
test_sock_connect_address()

Lib/test/test_asyncio/test_events.py

index 3720cc7560bc400584125996ecd4a5de9103127c..f8499dc1f036157bc310dae1ca2a3ebf636aefa8 100644 (file)
@@ -1335,12 +1335,11 @@ class EventLoopTestsMixin:
              'selector': self.loop._selector.__class__.__name__})
 
     def test_sock_connect_address(self):
-        families = [socket.AF_INET]
+        families = [(socket.AF_INET, ('www.python.org', 80))]
         if support.IPV6_ENABLED:
-            families.append(socket.AF_INET6)
+            families.append((socket.AF_INET6, ('www.python.org', 80, 0, 0)))
 
-        address = ('www.python.org', 80)
-        for family in families:
+        for family, address in families:
             for sock_type in (socket.SOCK_STREAM, socket.SOCK_DGRAM):
                 sock = socket.socket(family, sock_type)
                 with sock: