Stop skipping SecureTransport tests
MODIFY
src/urllib3/contrib/securetransport.py
src/urllib3/contrib/securetransport.py
@@ -819,6 +819,11 @@ class SecureTransportContext(object):
if capath is not None:
raise ValueError("SecureTransport does not support cert directories")
+ # Raise if cafile does not exist.
+ if cafile is not None:
+ with open(cafile):
+ pass
+
self._trust_bundle = cafile or cadata
def load_cert_chain(self, certfile, keyfile=None, password=None):

MODIFY
test/contrib/test_securetransport.py
test/contrib/test_securetransport.py
@@ -10,8 +10,6 @@ try:
except ImportError:
pass
-pytestmark = pytest.mark.skip()
-
def setup_module():
try:

MODIFY
test/with_dummyserver/test_socketlevel.py
test/with_dummyserver/test_socketlevel.py
@@ -54,6 +54,7 @@ from test import (
SHORT_TIMEOUT,
LONG_TIMEOUT,
notPyPy2,
+ notSecureTransport,
resolvesLocalhostFQDN,
)
@@ -1168,6 +1169,7 @@ class TestSSL(SocketDummyServerTestCase):
pool.request("GET", "/", retries=0)
assert isinstance(cm.value.reason, SSLError)
+ @notSecureTransport
def test_ssl_read_timeout(self):
timed_out = Event()
@@ -1395,7 +1397,7 @@ class TestSSL(SocketDummyServerTestCase):
Ensure that load_verify_locations raises SSLError for all backends
"""
with pytest.raises(SSLError):
- ssl_wrap_socket(None, ca_certs=os.devnull)
+ ssl_wrap_socket(None, ca_certs="/tmp/fake-file")
class TestErrorWrapping(SocketDummyServerTestCase):

Stop skipping SecureTransport tests