File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,7 +44,19 @@ def test_parse_file_exit_on_dir(tmp_path: Path):
4444 _parse_file_path (str (dir_path ))
4545
4646
47- def test_run_configures_logging_at_cli_entrypoint (monkeypatch : pytest .MonkeyPatch , tmp_path : Path ):
47+ @pytest .mark .parametrize (
48+ ("transport" , "expected_kwargs" ),
49+ [
50+ (None , {}),
51+ ("stdio" , {"transport" : "stdio" }),
52+ ],
53+ )
54+ def test_run_configures_logging_at_cli_entrypoint (
55+ monkeypatch : pytest .MonkeyPatch ,
56+ tmp_path : Path ,
57+ transport : str | None ,
58+ expected_kwargs : dict [str , str ],
59+ ):
4860 """The CLI owns process logging setup; importing or constructing the server does not."""
4961 file = tmp_path / "server.py"
5062 file .write_text ("server = object()" )
@@ -71,11 +83,11 @@ def fake_configure_logging(level: str) -> None:
7183 fake_configure_logging ,
7284 )
7385
74- run (f"{ file } :server" , transport = "stdio" )
86+ run (f"{ file } :server" , transport = transport )
7587
7688 assert calls == [
7789 ("logging" , "DEBUG" ),
78- ("run" , { "transport" : "stdio" } ),
90+ ("run" , expected_kwargs ),
7991 ]
8092
8193
You can’t perform that action at this time.
0 commit comments