structuredAttrs is enabled Sourcing python-remove-tests-dir-hook Sourcing python-catch-conflicts-hook.sh Sourcing python-remove-bin-bytecode-hook.sh Sourcing pypa-build-hook Using pypaBuildPhase Sourcing python-runtime-deps-check-hook Using pythonRuntimeDepsCheckHook Sourcing pypa-install-hook Using pypaInstallPhase Sourcing python-imports-check-hook.sh Using pythonImportsCheckPhase Sourcing python-metadata-check-hook.sh Using pythonMetadataCheckPhase Sourcing python-namespaces-hook Sourcing python-catch-conflicts-hook.sh Sourcing pytest-check-hook Using pytestCheckPhase Running phase: unpackPhase unpacking source archive /nix/store/6rc0s4a15hsdjmylz4bi6qb56ikfwni2-source source root is source setting SOURCE_DATE_EPOCH to timestamp 315619200 of file "source/wrangler.toml" Running phase: patchPhase /nix/var/nix/builds/nix-72896-2464402623/source/src/httpx2 /nix/var/nix/builds/nix-72896-2464402623/source Running phase: updateAutotoolsGnuConfigScriptsPhase Running phase: configurePhase no configure script, doing nothing Running phase: buildPhase Executing pypaBuildPhase Setting UV_DYNAMIC_VERSIONING_BYPASS to 2.9.1 Creating a wheel... pypa build flags: --no-isolation --outdir dist/ --wheel * Getting build dependencies for wheel... * Building wheel... Successfully built httpx2-2.9.1-py3-none-any.whl Finished creating a wheel... Finished executing pypaBuildPhase Running phase: pythonRuntimeDepsCheckHook Executing pythonRuntimeDepsCheck Checking runtime dependencies for httpx2-2.9.1-py3-none-any.whl Finished executing pythonRuntimeDepsCheck Running phase: installPhase Executing pypaInstallPhase Successfully installed httpx2-2.9.1-py3-none-any.whl Finished executing pypaInstallPhase Running phase: pythonOutputDistPhase Executing pythonOutputDistPhase Finished executing pythonOutputDistPhase Running phase: fixupPhase checking for references to /nix/var/nix/builds/nix-72896-2464402623/ in /nix/store/pb8mgixdv6j4lxa5fgxw9dq3hc8b6g9k-python3.14-httpx2-2.9.1-dist... patching script interpreter paths in /nix/store/pb8mgixdv6j4lxa5fgxw9dq3hc8b6g9k-python3.14-httpx2-2.9.1-dist checking for references to /nix/var/nix/builds/nix-72896-2464402623/ in /nix/store/3cl1yyis7am3zflr4m0f1b4hc2h791rw-python3.14-httpx2-2.9.1... patching script interpreter paths in /nix/store/3cl1yyis7am3zflr4m0f1b4hc2h791rw-python3.14-httpx2-2.9.1 stripping (with command strip and flags -S) in /nix/store/3cl1yyis7am3zflr4m0f1b4hc2h791rw-python3.14-httpx2-2.9.1/lib /nix/store/3cl1yyis7am3zflr4m0f1b4hc2h791rw-python3.14-httpx2-2.9.1/bin Rewriting #!/nix/store/4l8r0s2r5fna7src82b5fc2hixdvfyw0-python3-3.14.7/bin/python3.14 to #!/nix/store/4l8r0s2r5fna7src82b5fc2hixdvfyw0-python3-3.14.7 wrapping `/nix/store/3cl1yyis7am3zflr4m0f1b4hc2h791rw-python3.14-httpx2-2.9.1/bin/httpx2'... Executing pythonRemoveTestsDir Finished executing pythonRemoveTestsDir Running phase: installCheckPhase no Makefile or custom installCheckPhase, doing nothing Running phase: pythonCatchConflictsPhase Running phase: pythonRemoveBinBytecodePhase Running phase: pythonImportsCheckPhase Executing pythonImportsCheckPhase Check whether the following modules can be imported: httpx2 Running phase: pythonMetadataCheckPhase Executing pythonMetadataCheckPhase Running phase: pytestCheckPhase Executing pytestCheckPhase /nix/var/nix/builds/nix-72896-2464402623/source pytest flags: -m pytest -k not\ \(test_async_proxy_close\)\ and\ not\ \(test_sync_proxy_close\)\ and\ not\ \(test_logging_request\)\ and\ not\ \(test_logging_redirect_chain\)\ and\ not\ \(test_client_decode_text_using_autodetect\)\ and\ not\ \(test_client_decode_text_using_explicit_encoding\)\ and\ not\ \(test_response_decode_text_using_autodetect\)\ and\ not\ \(test_keepalive_ping\) tests/httpx2 ============================= test session starts ============================== platform darwin -- Python 3.14.7, pytest-9.1.1, pluggy-1.6.0 rootdir: /nix/var/nix/builds/nix-72896-2464402623/source configfile: pyproject.toml plugins: trio-0.8.0, anyio-4.14.2 collected 1647 items / 14 deselected / 1633 selected tests/httpx2/client/test_async_client.py ............................... [ 1%] ....................... [ 3%] tests/httpx2/client/test_auth.py ....................................... [ 5%] .................................s....... [ 8%] tests/httpx2/client/test_client.py .................................. [ 10%] tests/httpx2/client/test_cookies.py ....... [ 10%] tests/httpx2/client/test_event_hooks.py ......... [ 11%] tests/httpx2/client/test_headers.py ................. [ 12%] tests/httpx2/client/test_properties.py ........ [ 12%] tests/httpx2/client/test_proxies.py .................................... [ 15%] .............................. [ 16%] tests/httpx2/client/test_queryparams.py ... [ 17%] tests/httpx2/client/test_redirects.py ................................. [ 19%] tests/httpx2/models/test_cookies.py ....... [ 19%] tests/httpx2/models/test_headers.py ................................. [ 21%] tests/httpx2/models/test_queryparams.py .............. [ 22%] tests/httpx2/models/test_requests.py ........................ [ 23%] tests/httpx2/models/test_responses.py .................................. [ 25%] ........................................................................ [ 30%] [ 30%] tests/httpx2/models/test_url.py ........................................ [ 32%] ..................................................... [ 36%] tests/httpx2/models/test_whatwg.py ..................................... [ 38%] ........................................................................ [ 42%] ........................................................................ [ 47%] ........................................................................ [ 51%] ........................................................................ [ 55%] ........................................................................ [ 60%] ........................................................................ [ 64%] ........................................................................ [ 69%] ...................... [ 70%] tests/httpx2/test_alias.py ............ [ 71%] tests/httpx2/test_api.py ............. [ 72%] tests/httpx2/test_asgi.py ........................ [ 73%] tests/httpx2/test_auth.py ......... [ 74%] tests/httpx2/test_config.py ........................... [ 75%] tests/httpx2/test_content.py ........................................... [ 78%] . [ 78%] tests/httpx2/test_decoders.py .......................................... [ 80%] ... [ 81%] tests/httpx2/test_exceptions.py ... [ 81%] tests/httpx2/test_exported_members.py . [ 81%] tests/httpx2/test_main.py ........... [ 82%] tests/httpx2/test_multipart.py ...................................... [ 84%] tests/httpx2/test_sse.py .............................. [ 86%] tests/httpx2/test_status_codes.py ...... [ 86%] tests/httpx2/test_timeouts.py .......... [ 87%] tests/httpx2/test_utils.py ....................................... [ 89%] tests/httpx2/test_wsgi.py ............ [ 90%] tests/httpx2/websockets/test_api.py .................................... [ 92%] .....................................................................F [ 96%] tests/httpx2/websockets/test_high_level.py ............ [ 97%] tests/httpx2/websockets/test_transport.py .............................. [ 99%] .......... [100%] =================================== FAILURES =================================== _______________________ TestReceive.test_receive_timeout _______________________ self = def test_receive_timeout(self) -> None: class MockNetworkStream(NetworkStream): def __init__(self) -> None: self.connection = wsproto.connection.Connection(wsproto.connection.ConnectionType.SERVER) def read(self, max_bytes: int, timeout: float | None = None) -> bytes: time.sleep(0.2) return b"" def write(self, buffer: bytes, timeout: float | None = None) -> None: pass def close(self) -> None: pass stream = MockNetworkStream() with pytest.raises(TimeoutError): with WebSocketSession(stream) as websocket_session: > websocket_session.receive(timeout=0.1) tests/httpx2/websockets/test_api.py:255: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = timeout = 0.1 def receive(self, timeout: float | None = None) -> wsproto.events.Event: """ Receive an event from the server. Mainly useful to receive raw [wsproto.events.Event][wsproto.events.Event]. Most of the time, [receive_text()][httpx_ws.WebSocketSession.receive_text], [receive_bytes()][httpx_ws.WebSocketSession.receive_bytes], and [receive_json()][httpx_ws.WebSocketSession.receive_json] are preferred. Args: timeout: Number of seconds to wait for an event. If `None`, will block until an event is available. Returns: A raw [wsproto.events.Event][wsproto.events.Event]. Raises: TimeoutError: No event was received before the timeout delay. WebSocketDisconnect: The server closed the websocket. WebSocketNetworkError: A network error occured. Examples: Wait for an event until one is available. try: event = ws.receive() except WebSocketDisconnect: print("Connection closed") Wait for an event for 2 seconds. try: event = ws.receive(timeout=2.) except TimeoutError: print("No event received.") except WebSocketDisconnect: print("Connection closed") """ try: event = self._events.get(block=True, timeout=timeout) except queue.Empty as e: raise TimeoutError from e if isinstance(event, HTTPXWSException): > raise event E httpx2.websockets._exceptions.WebSocketNetworkError /nix/store/3cl1yyis7am3zflr4m0f1b4hc2h791rw-python3.14-httpx2-2.9.1/lib/python3.14/site-packages/httpx2/websockets/_api.py:319: WebSocketNetworkError =========================== short test summary info ============================ SKIPPED [1] tests/httpx2/client/test_auth.py:253: netrc files without a password are valid from Python >= 3.11 ========== 1 failed, 1631 passed, 1 skipped, 14 deselected in 24.57s ===========