From: Victor Stinner Date: Wed, 1 Nov 2017 02:48:14 +0000 (-0700) Subject: Fix test_socket.test_create_connection() (#4206) X-Git-Tag: v3.7.0a3~271 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=280c22a82a6756e9caffef031c564fd98f1b50e7;p=python Fix test_socket.test_create_connection() (#4206) bpo-31910: test_create_connection() now catchs also EADDRNOTAVAIL to fix the test on Travis CI. --- diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 84ec429133..41eac2396b 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -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)