Spaces:
Sleeping
Sleeping
Jeremiah Lowin commited on
Commit ·
9e4d18c
1
Parent(s): 0f3d0c4
Reset session after closing
Browse filesFiles changed (2)
267 unmodified lines268269270271272273267 unmodified linesasync def close(self):await self.transport.close()# --- MCP Client Methods ---267 unmodified lines268269270271272273274275267 unmodified linesasync def close(self):await self.transport.close()self._session = Noneself._initialize_result = None# --- MCP Client Methods ---
120 unmodified lines121122123124125126127128129120 unmodified linesclient = Client(transport=PythonStdioTransport(script_path=stdio_script))assert client.transport.keep_alive is Truewith pytest.raises(RuntimeError, match="Server session was closed unexpectedly"):async with client:await client.close()await client.call_tool("pid")120 unmodified lines121122123124125126127120 unmodified linesclient = Client(transport=PythonStdioTransport(script_path=stdio_script))assert client.transport.keep_alive is Trueasync with client:await client.close()with pytest.raises(RuntimeError, match="Client is not connected"):await client.call_tool("pid")
src/fastmcp/client/client.py+2
tests/client/test_stdio.py+3-5