summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorCarl Meyer <carl@oddbird.net>2021-03-27 21:52:28 (GMT)
committerGitHub <noreply@github.com>2021-03-27 21:52:28 (GMT)
commit29c451c6989c3c94fa0a9facf187c24f3cbf2420 (patch)
tree2a65396b6eb71551fdb3f2ae1072bdee307c808e /Lib
parenta53e9a7cf5912a44c5143e353912e44cfcfca7dc (diff)
downloadcpython-29c451c6989c3c94fa0a9facf187c24f3cbf2420.zip
cpython-29c451c6989c3c94fa0a9facf187c24f3cbf2420.tar.gz
cpython-29c451c6989c3c94fa0a9facf187c24f3cbf2420.tar.bz2
bpo-43562: fix test_ssl to skip on unreachable network (GH-24937)
This test checks result code of the connection directly, so it never raises an exception that can be suppressed by `support.transient_internet`. Directly support skipping the test in case of unreachable network.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_ssl.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index bed0d41..fa77406 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -2301,6 +2301,8 @@ class NetworkedTests(unittest.TestCase):
rc = s.connect_ex((REMOTE_HOST, 443))
if rc == 0:
self.skipTest("REMOTE_HOST responded too quickly")
+ elif rc == errno.ENETUNREACH:
+ self.skipTest("Network unreachable.")
self.assertIn(rc, (errno.EAGAIN, errno.EWOULDBLOCK))
@unittest.skipUnless(socket_helper.IPV6_ENABLED, 'Needs IPv6')