summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_socket.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-11-01 02:48:14 (GMT)
committerGitHub <noreply@github.com>2017-11-01 02:48:14 (GMT)
commit280c22a82a6756e9caffef031c564fd98f1b50e7 (patch)
tree93227bd68e75083d6b1101bf1742bf0941c3974f /Lib/test/test_socket.py
parent9ed83c40855b57c10988f76770a4eb825e034cd8 (diff)
downloadcpython-280c22a82a6756e9caffef031c564fd98f1b50e7.zip
cpython-280c22a82a6756e9caffef031c564fd98f1b50e7.tar.gz
cpython-280c22a82a6756e9caffef031c564fd98f1b50e7.tar.bz2
Fix test_socket.test_create_connection() (#4206)
bpo-31910: test_create_connection() now catchs also EADDRNOTAVAIL to fix the test on Travis CI.
Diffstat (limited to 'Lib/test/test_socket.py')
-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 84ec429..41eac23 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)