Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_http2_via_proxy failure on unexpected keyword argument #1525

Open
nieder opened this issue Feb 23, 2025 · 0 comments
Open

test_http2_via_proxy failure on unexpected keyword argument #1525

nieder opened this issue Feb 23, 2025 · 0 comments
Assignees
Labels
Bug Bug report in proxy server

Comments

@nieder
Copy link

nieder commented Feb 23, 2025

Describe the bug
building proxy.py with python3.10 on macOS, I get this test failure:

/sw/bin/python3.10 -m pytest -vv || exit 2
==================================================================================================== test session starts =====================================================================================================
platform darwin -- Python 3.10.4, pytest-7.4.4, pluggy-1.4.0 -- /sw/bin/python3.10
cachedir: .pytest_cache
rootdir: /sw/build.build/proxy.py-py310-2.4.10-1/proxy_py-2.4.10
configfile: pytest.ini
testpaths: tests/
plugins: cov-6.0.0, anyio-0.0.0, asyncio-0.21.1, mock-3.12.0, xdist-3.5.0
asyncio: mode=strict
collected 247 items                                                                                                                                                                                                          
...
tests/http/parser/test_tls_parser.py::TestTlsParser::test_parse_server_hello PASSED                                                                                                                [ 73%]
tests/http/proxy/test_http2.py::TestHttp2WithProxy::test_http2_via_proxy FAILED                                                                                                                    [ 74%]
tests/http/proxy/test_http_proxy.py::TestHttpProxyPlugin::test_proxy_plugin_not_initialized_unless_first_request_completes PASSED                                                                  [ 74%]
...
__________________________________________________________________________________________ TestHttp2WithProxy.test_http2_via_proxy ___________________________________________________________________________________________

self = <tests.http.proxy.test_http2.TestHttp2WithProxy testMethod=test_http2_via_proxy>

    def test_http2_via_proxy(self) -> None:
        assert self.PROXY
        proxy_url = 'http://localhost:%d' % self.PROXY.flags.port
        proxies: Dict[str, Any] = (
            {
                'proxies': {
                    'all://': proxy_url,
                },
            }
            # For Python>=3.11, proxies keyword is deprecated by httpx
            if sys.version_info < (3, 7, 0)
            else {'proxy': proxy_url}
        )
        response = httpx.get(
            'https://www.google.com',
            headers={'accept': 'application/json'},
>           verify=httpx.create_ssl_context(http2=True),
            timeout=httpx.Timeout(timeout=5.0),
            **proxies,
        )
E       TypeError: create_ssl_context() got an unexpected keyword argument 'http2'

proxies    = {'proxy': 'http://localhost:56231'}
proxy_url  = 'http://localhost:56231'
self       = <tests.http.proxy.test_http2.TestHttp2WithProxy testMethod=test_http2_via_proxy>

To Reproduce
Run proxy.py tests with python3.10 -m pytest

Expected behavior
The tests run and all should pass.

Version information

  • OS: macOS 10.14.6
  • Browser Firefox, but not applicable
  • Device: iMac
  • proxy.py Version 2.4.10

Additional context
httpx-0.28.1 is installed

@nieder nieder added the Bug Bug report in proxy server label Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug report in proxy server
Projects
None yet
Development

No branches or pull requests

2 participants