Skip to content

Commit 7d9bf9a

Browse files
test(mcp): Simulate stdio transport with memory streams (#5329)
Stop mocking transport layer of the `mcp` package in tests. Convert functions annotated with `@mcp.call_tool`, and analogous resource and prompt decorators, to async if, and only if, an exception is raised when going through the transport layer. Remove `test_resource_without_protocol`, `test_request_context_no_context` and `test_async_handlers_mixed`, because they are testing unreachable states. The former two are only possible when bypassing the transport layer. The latter is impossible because an exception is raised when invoking the synchronous `@mcp.call_tool`-annotated function.
1 parent 67721df commit 7d9bf9a

File tree

1 file changed

+293
-203
lines changed

1 file changed

+293
-203
lines changed

0 commit comments

Comments
 (0)