def system_must_validate_cert(f):
 @functools.wraps(f)
 def dec(*args, **kwargs):
  try:
   f(*args, **kwargs)
  except IOError as e:
   if ('CERTIFICATE_VERIFY_FAILED' in str(e)):
    raise unittest.SkipTest('system does not contain necessary certificates')
   raise
 return dec

def system_must_validate_cert ( f ) : @ functools . wraps ( f ) def dec ( * args , ** kwargs ) : try : f ( * args , ** kwargs ) except IOError as e : if ( 'CERTIFICATE_VERIFY_FAILED' in str ( e ) ) : raise unittest . SkipTest ( 'system does not contain necessary certificates' ) raise return dec
skip the test on tls certificate validation failures .