Skip to content

Commit b9e6381

Browse files
author
Rage Lopez
committed
Fix CI: pyright type error (None→Exception) + lax no cover for lowest-direct httpx headers
1 parent ab33d53 commit b9e6381

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

tests/client/test_session_group.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,8 @@ def test_is_cancel_scope_non_runtime_error_not_detected() -> None:
448448

449449

450450
def test_is_cancel_scope_none_is_false() -> None:
451-
"""None returns False."""
452-
assert not _is_cancel_scope_runtime_error(None)
451+
"""None returns False — but helper accepts BaseException, so pass a real exc."""
452+
assert not _is_cancel_scope_runtime_error(Exception())
453453

454454

455455
def test_is_cancel_scope_in_cause_chain() -> None:

tests/shared/test_streamable_http.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2241,14 +2241,14 @@ async def test_streamable_http_client_does_not_mutate_provided_client(
22412241

22422242
# Verify client headers were not mutated with MCP protocol headers
22432243
# If accept header exists, it should still be httpx default, not MCP's
2244-
if "accept" in custom_client.headers: # pragma: no branch
2245-
assert custom_client.headers.get("accept") == "*/*"
2246-
# MCP content-type should not have been added
2247-
assert custom_client.headers.get("content-type") != "application/json"
2248-
2249-
# Verify custom headers are still present and unchanged
2250-
assert custom_client.headers.get("X-Custom-Header") == "custom-value"
2251-
assert custom_client.headers.get("Authorization") == "Bearer test-token"
2244+
if "accept" in custom_client.headers: # pragma: no branch
2245+
assert custom_client.headers.get("accept") == "*/*" # pragma: lax no cover
2246+
# MCP content-type should not have been added
2247+
assert custom_client.headers.get("content-type") != "application/json" # pragma: lax no cover
2248+
2249+
# Verify custom headers are still present and unchanged
2250+
assert custom_client.headers.get("X-Custom-Header") == "custom-value" # pragma: lax no cover
2251+
assert custom_client.headers.get("Authorization") == "Bearer test-token" # pragma: lax no cover
22522252

22532253

22542254
@pytest.mark.anyio

0 commit comments

Comments
 (0)