@@ -144,7 +144,7 @@ def test_list_projects_enumerates_name_plugin_status(tmp_path, monkeypatch):
144144 _link_project (tmp_path , "beta-proj" , "plugins/beta" , "beta-proj" )
145145
146146 # status は docker に依存させず固定値を返す
147- def fake_status (entry : Path ):
147+ def fake_status (entry , counts = None ):
148148 return {"name" : entry .name , "status" : "running (2 containers)" , "count" : 2 }
149149
150150 monkeypatch .setattr (status_mod , "_container_status_for" , fake_status )
@@ -165,7 +165,7 @@ def test_list_projects_unknown_status_when_none(tmp_path, monkeypatch):
165165 _make_plugin_project (tmp_path , "repos/o--r/alpha" , "alpha-proj" )
166166 _link_project (tmp_path , "alpha-proj" , "repos/o--r/alpha" , "alpha-proj" )
167167
168- monkeypatch .setattr (status_mod , "_container_status_for" , lambda entry : None )
168+ monkeypatch .setattr (status_mod , "_container_status_for" , lambda entry , counts = None : None )
169169
170170 rows = project_mod .list_projects (tmp_path / "projects" )
171171 assert rows [0 ]["status" ] == "unknown"
@@ -179,7 +179,7 @@ def test_list_projects_real_dir_plugin_dash(tmp_path, monkeypatch):
179179 projects_dir .mkdir ()
180180 (projects_dir / "standalone" ).mkdir ()
181181
182- monkeypatch .setattr (status_mod , "_container_status_for" , lambda entry : None )
182+ monkeypatch .setattr (status_mod , "_container_status_for" , lambda entry , counts = None : None )
183183
184184 rows = project_mod .list_projects (projects_dir )
185185 assert rows [0 ]["name" ] == "standalone"
@@ -202,7 +202,7 @@ def test_cmd_project_list_prints_table(tmp_path, monkeypatch, capsys):
202202 _make_plugin_project (tmp_path , "repos/o--r/alpha" , "alpha-proj" )
203203 _link_project (tmp_path , "alpha-proj" , "repos/o--r/alpha" , "alpha-proj" )
204204 monkeypatch .setattr (status_mod , "_container_status_for" ,
205- lambda entry : {"name" : entry .name , "status" : "stopped" , "count" : 0 })
205+ lambda entry , counts = None : {"name" : entry .name , "status" : "stopped" , "count" : 0 })
206206
207207 args = types .SimpleNamespace (interactive = False )
208208 rc = project_mod .cmd_project_list (tmp_path , args )
@@ -231,7 +231,7 @@ def test_cmd_project_list_non_tty_falls_back_to_table(tmp_path, monkeypatch, cap
231231 _make_plugin_project (tmp_path , "repos/o--r/alpha" , "alpha-proj" )
232232 _link_project (tmp_path , "alpha-proj" , "repos/o--r/alpha" , "alpha-proj" )
233233 monkeypatch .setattr (status_mod , "_container_status_for" ,
234- lambda entry : {"name" : entry .name , "status" : "stopped" , "count" : 0 })
234+ lambda entry , counts = None : {"name" : entry .name , "status" : "stopped" , "count" : 0 })
235235 monkeypatch .setattr (project_mod .sys .stdin , "isatty" , lambda : False )
236236
237237 called = []
@@ -256,7 +256,7 @@ def test_cmd_project_list_stdout_non_tty_falls_back_to_table(tmp_path, monkeypat
256256 _make_plugin_project (tmp_path , "repos/o--r/alpha" , "alpha-proj" )
257257 _link_project (tmp_path , "alpha-proj" , "repos/o--r/alpha" , "alpha-proj" )
258258 monkeypatch .setattr (status_mod , "_container_status_for" ,
259- lambda entry : {"name" : entry .name , "status" : "stopped" , "count" : 0 })
259+ lambda entry , counts = None : {"name" : entry .name , "status" : "stopped" , "count" : 0 })
260260 monkeypatch .setattr (project_mod .sys .stdin , "isatty" , lambda : True )
261261 monkeypatch .setattr (project_mod .sys .stdout , "isatty" , lambda : False )
262262
@@ -285,7 +285,7 @@ def test_cmd_project_list_interactive_selects_and_ups(tmp_path, monkeypatch):
285285 _link_project (tmp_path , "alpha-proj" , "repos/o--r/alpha" , "alpha-proj" )
286286 _make_plugin_project (tmp_path , "plugins/beta" , "beta-proj" )
287287 _link_project (tmp_path , "beta-proj" , "plugins/beta" , "beta-proj" )
288- monkeypatch .setattr (status_mod , "_container_status_for" , lambda entry : None )
288+ monkeypatch .setattr (status_mod , "_container_status_for" , lambda entry , counts = None : None )
289289
290290 # 対話選択は TTY 環境でのみ起動するため isatty を True に固定する。
291291 monkeypatch .setattr (project_mod .sys .stdin , "isatty" , lambda : True )
@@ -313,7 +313,7 @@ def test_cmd_project_list_interactive_empty_input_aborts(tmp_path, monkeypatch):
313313
314314 _make_plugin_project (tmp_path , "repos/o--r/alpha" , "alpha-proj" )
315315 _link_project (tmp_path , "alpha-proj" , "repos/o--r/alpha" , "alpha-proj" )
316- monkeypatch .setattr (status_mod , "_container_status_for" , lambda entry : None )
316+ monkeypatch .setattr (status_mod , "_container_status_for" , lambda entry , counts = None : None )
317317 monkeypatch .setattr (project_mod .sys .stdin , "isatty" , lambda : True )
318318 monkeypatch .setattr (project_mod .sys .stdout , "isatty" , lambda : True )
319319 monkeypatch .setattr ("builtins.input" , lambda * a , ** k : "" )
@@ -335,7 +335,7 @@ def test_cmd_project_list_interactive_non_tty_eof(tmp_path, monkeypatch):
335335
336336 _make_plugin_project (tmp_path , "repos/o--r/alpha" , "alpha-proj" )
337337 _link_project (tmp_path , "alpha-proj" , "repos/o--r/alpha" , "alpha-proj" )
338- monkeypatch .setattr (status_mod , "_container_status_for" , lambda entry : None )
338+ monkeypatch .setattr (status_mod , "_container_status_for" , lambda entry , counts = None : None )
339339
340340 def raise_eof (* a , ** k ):
341341 raise EOFError
@@ -360,7 +360,7 @@ def test_cmd_project_list_interactive_keyboard_interrupt_aborts(tmp_path, monkey
360360
361361 _make_plugin_project (tmp_path , "repos/o--r/alpha" , "alpha-proj" )
362362 _link_project (tmp_path , "alpha-proj" , "repos/o--r/alpha" , "alpha-proj" )
363- monkeypatch .setattr (status_mod , "_container_status_for" , lambda entry : None )
363+ monkeypatch .setattr (status_mod , "_container_status_for" , lambda entry , counts = None : None )
364364
365365 def raise_interrupt (* a , ** k ):
366366 raise KeyboardInterrupt
@@ -385,7 +385,7 @@ def test_cmd_project_list_interactive_out_of_range_reprompts(tmp_path, monkeypat
385385
386386 _make_plugin_project (tmp_path , "repos/o--r/alpha" , "alpha-proj" )
387387 _link_project (tmp_path , "alpha-proj" , "repos/o--r/alpha" , "alpha-proj" )
388- monkeypatch .setattr (status_mod , "_container_status_for" , lambda entry : None )
388+ monkeypatch .setattr (status_mod , "_container_status_for" , lambda entry , counts = None : None )
389389
390390 monkeypatch .setattr (project_mod .sys .stdin , "isatty" , lambda : True )
391391 monkeypatch .setattr (project_mod .sys .stdout , "isatty" , lambda : True )
@@ -410,7 +410,7 @@ def test_cmd_project_list_interactive_non_numeric_reprompts(tmp_path, monkeypatc
410410
411411 _make_plugin_project (tmp_path , "repos/o--r/alpha" , "alpha-proj" )
412412 _link_project (tmp_path , "alpha-proj" , "repos/o--r/alpha" , "alpha-proj" )
413- monkeypatch .setattr (status_mod , "_container_status_for" , lambda entry : None )
413+ monkeypatch .setattr (status_mod , "_container_status_for" , lambda entry , counts = None : None )
414414
415415 monkeypatch .setattr (project_mod .sys .stdin , "isatty" , lambda : True )
416416 monkeypatch .setattr (project_mod .sys .stdout , "isatty" , lambda : True )
@@ -559,7 +559,7 @@ def test_get_container_status_uses_per_entry(tmp_path, monkeypatch):
559559 (projects_dir / "b" ).mkdir ()
560560
561561 monkeypatch .setattr (status_mod , "_container_status_for" ,
562- lambda entry : {"name" : entry .name , "status" : "stopped" , "count" : 0 })
562+ lambda entry , counts = None : {"name" : entry .name , "status" : "stopped" , "count" : 0 })
563563 results = status_mod ._get_container_status (projects_dir )
564564 names = sorted (r ["name" ] for r in results )
565565 assert names == ["a" , "b" ]
0 commit comments