Skip to content

Commit 20b2f2b

Browse files
bpo-43562: fix test_ssl to skip on unreachable network (GH-24937) (GH-25047)
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. (cherry picked from commit 29c451c) Co-authored-by: Carl Meyer <carl@oddbird.net> Co-authored-by: Carl Meyer <carl@oddbird.net>
1 parent 3b6e61e commit 20b2f2b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Lib/test/test_ssl.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,6 +2271,8 @@ def test_timeout_connect_ex(self):
22712271
rc = s.connect_ex((REMOTE_HOST, 443))
22722272
if rc == 0:
22732273
self.skipTest("REMOTE_HOST responded too quickly")
2274+
elif rc == errno.ENETUNREACH:
2275+
self.skipTest("Network unreachable.")
22742276
self.assertIn(rc, (errno.EAGAIN, errno.EWOULDBLOCK))
22752277

22762278
@unittest.skipUnless(support.IPV6_ENABLED, 'Needs IPv6')

0 commit comments

Comments
 (0)