Commit b9955e0
committed
Migrate test files from create_connected_server_and_client_session
Migrate the following files to use the new Client API:
- tests/server/fastmcp/test_server.py: Use Client.from_server(mcp) instead of
client_session(mcp._mcp_server)
- tests/shared/test_session.py: Use InMemoryTransport + ClientSession for
low-level session tests
- tests/shared/test_progress_notifications.py: Use InMemoryTransport for
progress callback exception test
- examples/fastmcp/weather_structured.py: Use Client.from_server(mcp) for
the example
The high-level Client API is used for tests that just need to call tools,
resources, and prompts. The low-level InMemoryTransport + ClientSession
pattern is used for tests that need direct session access (e.g., _in_flight,
send_notification, send_request).1 parent 64abe69 commit b9955e0
File tree
4 files changed
+116
-114
lines changed- examples/fastmcp
- tests
- server/fastmcp
4 files changed
+116
-114
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | | - | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| |||
0 commit comments