diff options
| author | hodbn <hodbn@users.noreply.github.com> | 2020-06-24 12:38:17 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-24 14:38:17 -0500 |
| commit | fd1ad730bae89992e9591e84494713fc1cde3ad4 (patch) | |
| tree | c9e23ffdc871318beabbc729287be7104745a3cc /test/with_dummyserver | |
| parent | 444f044e0e02f52054c6961f6dfdf4111654f087 (diff) | |
| download | urllib3-fd1ad730bae89992e9591e84494713fc1cde3ad4.tar.gz | |
Fix testing of SSLKEYLOGFILE on AppVeyor
Diffstat (limited to 'test/with_dummyserver')
| -rw-r--r-- | test/with_dummyserver/test_https.py | 10 | ||||
| -rw-r--r-- | test/with_dummyserver/test_socketlevel.py | 5 |
2 files changed, 5 insertions, 10 deletions
diff --git a/test/with_dummyserver/test_https.py b/test/with_dummyserver/test_https.py index e0b2504b..414aea49 100644 --- a/test/with_dummyserver/test_https.py +++ b/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( diff --git a/test/with_dummyserver/test_socketlevel.py b/test/with_dummyserver/test_socketlevel.py index ec4fc8db..3490e7e9 100644 --- a/test/with_dummyserver/test_socketlevel.py +++ b/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"" |
