Unverified Kaydet (Commit) 280c22a8 authored tarafından Victor Stinner's avatar Victor Stinner Kaydeden (comit) GitHub

Fix test_socket.test_create_connection() (#4206)

bpo-31910: test_create_connection() now catchs also EADDRNOTAVAIL to
fix the test on Travis CI.
üst 9ed83c40
...@@ -4533,6 +4533,10 @@ class NetworkConnectionNoServer(unittest.TestCase): ...@@ -4533,6 +4533,10 @@ class NetworkConnectionNoServer(unittest.TestCase):
expected_errnos = [ errno.ECONNREFUSED, ] expected_errnos = [ errno.ECONNREFUSED, ]
if hasattr(errno, 'ENETUNREACH'): if hasattr(errno, 'ENETUNREACH'):
expected_errnos.append(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) self.assertIn(cm.exception.errno, expected_errnos)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment