Fix test_socket.test_create_connection() (#4206)
bpo-31910: test_create_connection() now catchs also EADDRNOTAVAIL to fix the test on Travis CI.
This commit is contained in:
parent
9ed83c4085
commit
280c22a82a
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue