summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2017-11-01 13:07:25 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2017-11-01 13:07:25 (GMT)
commit89b84b026b389f3c61cbbc5ee89afd8248721b0d (patch)
treeb0d4629212a4e3f06535a86e52e73eb96cd504f6 /Lib/test
parentf44a6299e2fd2154436df2774c142ca4a7e64b3a (diff)
downloadcpython-89b84b026b389f3c61cbbc5ee89afd8248721b0d.zip
cpython-89b84b026b389f3c61cbbc5ee89afd8248721b0d.tar.gz
cpython-89b84b026b389f3c61cbbc5ee89afd8248721b0d.tar.bz2
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)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_socket.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 80dfc40..034a3da 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)