mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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 29c451c698
)
Co-authored-by: Carl Meyer <carl@oddbird.net>
Co-authored-by: Carl Meyer <carl@oddbird.net>
This commit is contained in:
parent
f1d53bcd53
commit
acb584958e
1 changed files with 2 additions and 0 deletions
|
@ -2276,6 +2276,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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue