File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -274,17 +274,26 @@ def fake_run(coro):
274274 assert captured ["server_name" ] == "custom"
275275
276276
277- def test_single_server_mcp_config_rejects_multiple_servers_via_cli (runner : CliRunner ) -> None :
277+ def test_single_server_mcp_config_rejects_multiple_servers_via_cli (
278+ runner : CliRunner , monkeypatch : pytest .MonkeyPatch
279+ ) -> None :
278280 config_json = (
279281 '{"mcpServers": {'
280282 '"weather": {"command": "uvx", "args": ["mcp-weather"]}, '
281283 '"calendar": {"command": "uvx", "args": ["mcp-calendar"]}'
282284 "}}"
283285 )
286+ async_main_called = False
287+
288+ async def fake_async_main (** kwargs : Any ) -> None :
289+ nonlocal async_main_called
290+ async_main_called = True
291+
292+ monkeypatch .setattr (main_module , "_async_main" , fake_async_main )
284293 result = runner .invoke (app , [config_json ])
285294
286295 assert result .exit_code != 0
287- assert re . search ( r"exactly one\s+server" , _strip_ansi ( result . output ))
296+ assert async_main_called is False
288297
289298
290299async def test_server_uses_mcp_config_transport_for_single_server_json (monkeypatch : pytest .MonkeyPatch ) -> None :
You can’t perform that action at this time.
0 commit comments