diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2017-11-01 13:07:25 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2017-11-01 13:07:25 (GMT) |
commit | 89b84b026b389f3c61cbbc5ee89afd8248721b0d (patch) | |
tree | b0d4629212a4e3f06535a86e52e73eb96cd504f6 /Lib/test | |
parent | f44a6299e2fd2154436df2774c142ca4a7e64b3a (diff) | |
download | cpython-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.py | 4 |
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) |