Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

test(mcp): stop a comprehension variable from shadowing the body() helper (#42906)

yuneng-jiang2cbaa4c9b5a4
diff --git a/tests/integration/mcp/test_mcp_user_env_vars.py b/tests/integration/mcp/test_mcp_user_env_vars.py
index d9cecaccadb..0170eb77491 100644
--- a/tests/integration/mcp/test_mcp_user_env_vars.py
+++ b/tests/integration/mcp/test_mcp_user_env_vars.py
@@ -195,7 +195,7 @@ def test_malformed_bodies_missing_users_and_foreign_servers_are_rejected(gateway
path: Final = f"/v1/mcp/server/{identity}/user-env-vars"
payload: Final[dict[str, JsonValue]] = {"values": {TOKEN: "x"}}
malformed: Final[tuple[dict[str, JsonValue], ...]] = ({"values": {TOKEN: 7}}, {"values": ["a"]}, {})
- assert [gateway.request("POST", path, body, key=key).status_code for body in malformed] == [422, 422, 422]
+ assert [gateway.request("POST", path, bad, key=key).status_code for bad in malformed] == [422, 422, 422]
assert set_names(env_status(gateway, key, identity)) == {TOKEN: False}
assert [gateway.client.request(method, path, json=payload).status_code for method in METHODS] == [401, 401, 401]
no_user: Final = tuple(gateway.request(method, path, payload, key=userless) for method in METHODS)