mirror of
https://github.com/python/cpython.git
synced 2025-12-07 17:57:56 +00:00
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
1 changed files with 4 additions and 0 deletions
|
|
@ -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)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue