Fix testing of SSLKEYLOGFILE on AppVeyor
MODIFY
test/with_dummyserver/test_https.py
test/with_dummyserver/test_https.py
@@ -698,16 +698,10 @@ class TestHTTPS(HTTPSDummyServerTestCase):
finally:
conn.close()
- @pytest.mark.skipif(
- not hasattr(ssl.SSLContext, "keylog_filename"),
- reason="requires OpenSSL 1.1.1+",
- )
@pytest.mark.skipif(sys.version_info < (3, 8), reason="requires python 3.8+")
- @pytest.mark.skipif(
- sys.platform == "win32",
- reason="does not work reliably in Appveyor test enviroment for not yet known reasons",
- )
def test_sslkeylogfile(self, tmpdir, monkeypatch):
+ if not hasattr(util.SSLContext, "keylog_filename"):
+ pytest.skip("requires OpenSSL 1.1.1+")
keylog_file = tmpdir.join("keylogfile.txt")
monkeypatch.setenv("SSLKEYLOGFILE", str(keylog_file))
with HTTPSConnectionPool(

MODIFY
test/with_dummyserver/test_socketlevel.py
test/with_dummyserver/test_socketlevel.py
@@ -10,8 +10,8 @@ from urllib3.exceptions import (
ProtocolError,
)
from urllib3.packages.six.moves import http_client as httplib
+from urllib3 import util
from urllib3.util import ssl_wrap_socket
-from urllib3.util.ssl_ import HAS_SNI
from urllib3.util import ssl_
from urllib3.util.timeout import Timeout
from urllib3.util.retry import Retry
@@ -87,8 +87,9 @@ class TestCookies(SocketDummyServerTestCase):
class TestSNI(SocketDummyServerTestCase):
- @pytest.mark.skipif(not HAS_SNI, reason="SNI-support not available")
def test_hostname_in_first_request_packet(self):
+ if not util.HAS_SNI:
+ pytest.skip("SNI-support not available")
done_receiving = Event()
self.buf = b""

Fix testing of SSLKEYLOGFILE on AppVeyor