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): assert the misconfigured credential message on fail-closed rejections

Devin AIe3755a88e72e
diff --git a/tests/integration/mcp/test_mcp_lifecycle.py b/tests/integration/mcp/test_mcp_lifecycle.py
index 120fc2a5a2f..7ca5f3a69b7 100644
--- a/tests/integration/mcp/test_mcp_lifecycle.py
+++ b/tests/integration/mcp/test_mcp_lifecycle.py
@@ -7,12 +7,11 @@ import pytest
import yaml
from hypothesis import strategies as st
from hypothesis.stateful import RuleBasedStateMachine, invariant, rule, run_state_machine_as_test
-
from integration._support.client import Gateway
from integration._support.database import read_rows
from integration._support.generation import LIFECYCLE_SETTINGS, bounded_http_requests
-from integration._support.process import owned_proxy
from integration._support.mcp import call_tool, mcp_peer, register_mcp, tool_names
+from integration._support.process import owned_proxy
@pytest.mark.covers("mcp.call_tool.saved_headers.reach_actual_transport")
@@ -199,6 +198,7 @@ def test_warm_credential_removal_rejects_without_upstream_traffic(gateway: Gatew
else call_tool(gateway, key, identity, names["add"], {"a": 3, "b": 5})
)
assert rejected.status_code == 500, rejected.text
+ assert "requires a usable upstream credential" in rejected.text, rejected.text
assert peer.drain() == (), "missing static credential escaped to upstream"
changed = gateway.request(
"PUT",