[Python-checkins] Fix test_socket.test_create_connection() (GH-4206) (#4208)

Victor Stinner webhook-mailer at python.org
Wed Nov 1 09:07:28 EDT 2017


https://github.com/python/cpython/commit/89b84b026b389f3c61cbbc5ee89afd8248721b0d
commit: 89b84b026b389f3c61cbbc5ee89afd8248721b0d
branch: 3.6
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Victor Stinner <victor.stinner at gmail.com>
date: 2017-11-01T06:07:25-07:00
summary:

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)

files:
M Lib/test/test_socket.py

diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 80dfc405c71..034a3da43f8 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -4373,6 +4373,10 @@ def test_create_connection(self):
         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)
 



More information about the Python-checkins mailing list