From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Wed, 1 Nov 2017 13:07:25 +0000 (-0700) Subject: Fix test_socket.test_create_connection() (GH-4206) (#4208) X-Git-Tag: v3.6.4rc1~114 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=89b84b026b389f3c61cbbc5ee89afd8248721b0d;p=thirdparty%2FPython%2Fcpython.git Fix test_socket.test_create_connection() (GH-4206) (#4208) bpo-31910: test_create_connection() now catchs also EADDRNOTAVAIL to fix the test on Travis CI. (cherry picked from commit 280c22a82a6756e9caffef031c564fd98f1b50e7) --- diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 80dfc405c718..034a3da43f86 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -4373,6 +4373,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)