mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
don't fail tests when www.python.org can't be validated by the system
This commit is contained in:
parent
5ef586f25a
commit
2615e9e293
2 changed files with 13 additions and 0 deletions
|
@ -691,6 +691,18 @@ def _is_ipv6_enabled():
|
|||
|
||||
IPV6_ENABLED = _is_ipv6_enabled()
|
||||
|
||||
def system_must_validate_cert(f):
|
||||
"""Skip the test on TLS certificate validation failures."""
|
||||
@functools.wraps(f)
|
||||
def dec(*args, **kwargs):
|
||||
try:
|
||||
f(*args, **kwargs)
|
||||
except IOError as e:
|
||||
if e.reason == "CERTIFICATE_VERIFY_FAILED":
|
||||
raise unittest.SkipTest("system does not contain "
|
||||
"necessary certificates")
|
||||
raise
|
||||
return dec
|
||||
|
||||
# A constant likely larger than the underlying OS pipe buffer size, to
|
||||
# make writes blocking.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue