Skip to content

Commit b069c5b

Browse files
ashwin-antclaude
andauthored
test: add debug output and model to MCP e2e tests (#536)
## Summary - Add print statements to MCP e2e tests for debug visibility of message types and content - Specify `model="claude-opus-4-5"` in the permission enforcement test - Print the `executions` dict in the permission test for easier debugging ## Test plan - [ ] Run `python -m pytest e2e-tests/test_sdk_mcp_tools.py -v -s` to verify debug output appears - [ ] Confirm permission enforcement test passes with specified model ## Changelog <!-- CHANGELOG:START --> <!-- CHANGELOG:END --> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent abf5fae commit b069c5b

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

e2e-tests/test_sdk_mcp_tools.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async def echo_tool(args: dict[str, Any]) -> dict[str, Any]:
4343
await client.query("Call the mcp__test__echo tool with any text")
4444

4545
async for message in client.receive_response():
46-
pass # Just consume messages
46+
print(f" [{type(message).__name__}] {message}")
4747

4848
# Check if the actual Python function was called
4949
assert "echo" in executions, "Echo tool function was not executed"
@@ -74,6 +74,7 @@ async def greet_tool(args: dict[str, Any]) -> dict[str, Any]:
7474
)
7575

7676
options = ClaudeAgentOptions(
77+
model="claude-opus-4-5",
7778
mcp_servers={"test": server},
7879
disallowed_tools=["mcp__test__echo"], # Block echo tool
7980
allowed_tools=["mcp__test__greet"], # But allow greet
@@ -85,9 +86,10 @@ async def greet_tool(args: dict[str, Any]) -> dict[str, Any]:
8586
)
8687

8788
async for message in client.receive_response():
88-
pass # Just consume messages
89+
print(f" [{type(message).__name__}] {message}")
8990

9091
# Check actual function executions
92+
print(f" Executions: {executions}")
9193
assert "echo" not in executions, "Disallowed echo tool was executed"
9294
assert "greet" in executions, "Allowed greet tool was not executed"
9395

@@ -127,7 +129,7 @@ async def greet_tool(args: dict[str, Any]) -> dict[str, Any]:
127129
)
128130

129131
async for message in client.receive_response():
130-
pass # Just consume messages
132+
print(f" [{type(message).__name__}] {message}")
131133

132134
# Both tools should have been executed
133135
assert "echo" in executions, "Echo tool was not executed"
@@ -161,6 +163,6 @@ async def echo_tool(args: dict[str, Any]) -> dict[str, Any]:
161163
await client.query("Call the mcp__noperm__echo tool")
162164

163165
async for message in client.receive_response():
164-
pass # Just consume messages
166+
print(f" [{type(message).__name__}] {message}")
165167

166168
assert "echo" not in executions, "SDK MCP tool was executed"

0 commit comments

Comments
 (0)