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

Victor Stinner webhook-mailer at python.org
Tue Oct 31 22:48:16 EDT 2017


https://github.com/python/cpython/commit/280c22a82a6756e9caffef031c564fd98f1b50e7
commit: 280c22a82a6756e9caffef031c564fd98f1b50e7
branch: master
author: Victor Stinner <victor.stinner at gmail.com>
committer: GitHub <noreply at github.com>
date: 2017-10-31T19:48:14-07:00
summary:

Fix test_socket.test_create_connection() (#4206)

bpo-31910: test_create_connection() now catchs also EADDRNOTAVAIL to
fix the test on Travis CI.

files:
M Lib/test/test_socket.py

diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 84ec4291335..41eac2396bb 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -4533,6 +4533,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