Skip to content

Commit acb5849

Browse files
bpo-43562: fix test_ssl to skip on unreachable network (GH-24937) (GH-25046)
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 <[email protected]> Co-authored-by: Carl Meyer <[email protected]>
1 parent f1d53bc commit acb5849

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Lib/test/test_ssl.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2276,6 +2276,8 @@ def test_timeout_connect_ex(self):
22762276
rc = s.connect_ex((REMOTE_HOST, 443))
22772277
if rc == 0:
22782278
self.skipTest("REMOTE_HOST responded too quickly")
2279+
elif rc == errno.ENETUNREACH:
2280+
self.skipTest("Network unreachable.")
22792281
self.assertIn(rc, (errno.EAGAIN, errno.EWOULDBLOCK))
22802282

22812283
@unittest.skipUnless(socket_helper.IPV6_ENABLED, 'Needs IPv6')

0 commit comments

Comments
 (0)