]> granicus.if.org Git - python/commitdiff
Fix test_socket.test_create_connection() (#4206)
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 1 Nov 2017 02:48:14 +0000 (19:48 -0700)
committerGitHub <noreply@github.com>
Wed, 1 Nov 2017 02:48:14 +0000 (19:48 -0700)
bpo-31910: test_create_connection() now catchs also EADDRNOTAVAIL to
fix the test on Travis CI.

Lib/test/test_socket.py

index 84ec429133562ebf94394b8a5d19934cbfb25deb..41eac2396bb4102e5a9924afad38c037dd2ae24b 100644 (file)
@@ -4533,6 +4533,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)