From 34ef90d1bae934e4910bdc59bb97188b6d1c82ef Mon Sep 17 00:00:00 2001 From: coletdjnz Date: Sun, 14 Jul 2024 12:40:27 +1200 Subject: [PATCH] try this --- test/test_http_proxy.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/test/test_http_proxy.py b/test/test_http_proxy.py index 2874626ad..1658c7949 100644 --- a/test/test_http_proxy.py +++ b/test/test_http_proxy.py @@ -12,6 +12,7 @@ from socketserver import BaseRequestHandler, ThreadingTCPServer import pytest +import platform from test.helper import http_server_port, verify_address_availability from test.test_networking import TEST_DIR @@ -445,11 +446,11 @@ def test_http_connect_source_address(self, handler, ctx): assert proxy_info['client_address'][0] == source_address @pytest.mark.skipif(urllib3 is None, reason='requires urllib3 to test') - # @pytest.mark.skip_handler_if( - # 'Websockets', lambda request: - # (platform.python_implementation() == 'PyPy' - # and request.getfixturevalue('ctx').REQUEST_PROTO == 'wss'), - # 'PyPy sometimes fails with WSS over TLS tests, unknown reason') + @pytest.mark.skip_handler_if( + 'Websockets', lambda request: + (platform.python_implementation() == 'PyPy' + and request.getfixturevalue('ctx').REQUEST_PROTO == 'wss'), + 'PyPy sometimes fails with WSS over TLS tests, unknown reason') def test_https_connect_proxy(self, handler, ctx): with ctx.http_server(HTTPSConnectProxyHandler) as server_address: with handler(verify=False, proxies={ctx.REQUEST_PROTO: f'https://{server_address}'}) as rh: @@ -459,11 +460,11 @@ def test_https_connect_proxy(self, handler, ctx): assert 'Proxy-Authorization' not in proxy_info['headers'] @pytest.mark.skipif(urllib3 is None, reason='requires urllib3 to test') - # @pytest.mark.skip_handler_if( - # 'Websockets', lambda request: - # (platform.python_implementation() == 'PyPy' - # and request.getfixturevalue('ctx').REQUEST_PROTO == 'wss'), - # 'PyPy sometimes fails with WSS over TLS tests, unknown reason') + @pytest.mark.skip_handler_if( + 'Websockets', lambda request: + (platform.python_implementation() == 'PyPy' + and request.getfixturevalue('ctx').REQUEST_PROTO == 'wss'), + 'PyPy sometimes fails with WSS over TLS tests, unknown reason') def test_https_connect_verify_failed(self, handler, ctx): with ctx.http_server(HTTPSConnectProxyHandler) as server_address: with handler(verify=True, proxies={ctx.REQUEST_PROTO: f'https://{server_address}'}) as rh: @@ -474,11 +475,11 @@ def test_https_connect_verify_failed(self, handler, ctx): ctx.proxy_info_request(rh) @pytest.mark.skipif(urllib3 is None, reason='requires urllib3 to test') - # @pytest.mark.skip_handler_if( - # 'Websockets', lambda request: - # (platform.python_implementation() == 'PyPy' - # and request.getfixturevalue('ctx').REQUEST_PROTO == 'wss'), - # 'PyPy sometimes fails with WSS over TLS tests, unknown reason') + @pytest.mark.skip_handler_if( + 'Websockets', lambda request: + (platform.python_implementation() == 'PyPy' + and request.getfixturevalue('ctx').REQUEST_PROTO == 'wss'), + 'PyPy sometimes fails with WSS over TLS tests, unknown reason') def test_https_connect_proxy_auth(self, handler, ctx): with ctx.http_server(HTTPSConnectProxyHandler, username='test', password='test') as server_address: with handler(verify=False, proxies={ctx.REQUEST_PROTO: f'https://test:test@{server_address}'}) as rh: