From d98ab542f6ab01068a77a3a8949b8f8c8f74905b Mon Sep 17 00:00:00 2001 From: coletdjnz Date: Sat, 18 May 2024 17:42:11 +1200 Subject: [PATCH] Skip WSS in TLS tests for PyPy --- test/test_http_proxy.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/test_http_proxy.py b/test/test_http_proxy.py index 058c6b253..99c9c73aa 100644 --- a/test/test_http_proxy.py +++ b/test/test_http_proxy.py @@ -442,6 +442,11 @@ class TestHTTPConnectProxy: 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') 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: @@ -451,6 +456,11 @@ class TestHTTPConnectProxy: 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') 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: @@ -461,6 +471,11 @@ class TestHTTPConnectProxy: 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') 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: