Skip to content

Commit 29c451c

Browse files
authored
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.
1 parent a53e9a7 commit 29c451c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Lib/test/test_ssl.py

+2
Original file line numberDiff line numberDiff line change
@@ -2301,6 +2301,8 @@ def test_timeout_connect_ex(self):
23012301
rc = s.connect_ex((REMOTE_HOST, 443))
23022302
if rc == 0:
23032303
self.skipTest("REMOTE_HOST responded too quickly")
2304+
elif rc == errno.ENETUNREACH:
2305+
self.skipTest("Network unreachable.")
23042306
self.assertIn(rc, (errno.EAGAIN, errno.EWOULDBLOCK))
23052307

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

0 commit comments

Comments
 (0)