]> granicus.if.org Git - python/commitdiff
Fix test_socket.test_create_connection() (GH-4206) (#4209)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 1 Nov 2017 13:08:40 +0000 (06:08 -0700)
committerVictor Stinner <victor.stinner@gmail.com>
Wed, 1 Nov 2017 13:08:40 +0000 (06:08 -0700)
bpo-31910: test_create_connection() now catchs also EADDRNOTAVAIL to
fix the test on Travis CI.
(cherry picked from commit 280c22a82a6756e9caffef031c564fd98f1b50e7)

Lib/test/test_socket.py

index bef1872822623788f97a81b379110bab31416e9d..1126fc2b77bb17d51c29c327bca7ba8c7fdd4073 100644 (file)
@@ -1358,6 +1358,10 @@ class NetworkConnectionNoServer(unittest.TestCase):
         expected_errnos = [ errno.ECONNREFUSED, ]
         if hasattr(errno, 'ENETUNREACH'):
             expected_errnos.append(errno.ENETUNREACH)
+        if hasattr(errno, 'EADDRNOTAVAIL'):
+            # bpo-31910: socket.create_connection() fails randomly
+            # with EADDRNOTAVAIL on Travis CI
+            expected_errnos.append(errno.EADDRNOTAVAIL)
 
         self.assertIn(cm.exception.errno, expected_errnos)