Skip to content

Commit 8619114

Browse files
committed
ControlModeEngine(test[typing]): fix lint typing for set_client_flags stub
why: Clear ruff/mypy warnings introduced by set_client_flags tests. what: - Mark DummyCmd attributes as ClassVar - Coerce stub command args to strings and drop unused ignore
1 parent 55ac83f commit 8619114

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/test_control_mode_engine.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,17 +362,19 @@ def test_set_client_flags_builds_refresh_client(case: SetClientFlagsCase) -> Non
362362
calls: list[tuple[str, tuple[str, ...], tuple[str, ...]]] = []
363363

364364
class DummyCmd:
365-
stdout: list[str] = []
366-
stderr: list[str] = []
367-
returncode = 0
365+
stdout: t.ClassVar[list[str]] = []
366+
stderr: t.ClassVar[list[str]] = []
367+
returncode: t.ClassVar[int] = 0
368368

369369
def fake_run(
370370
cmd: str,
371371
cmd_args: t.Sequence[str | int] | None = None,
372372
server_args: t.Sequence[str | int] | None = None,
373373
timeout: float | None = None,
374-
) -> DummyCmd: # type: ignore[override]
375-
calls.append((cmd, tuple(cmd_args or ()), tuple(server_args or ())))
374+
) -> DummyCmd:
375+
cmd_args_tuple = tuple(str(a) for a in (cmd_args or ()))
376+
server_args_tuple = tuple(str(a) for a in (server_args or ()))
377+
calls.append((cmd, cmd_args_tuple, server_args_tuple))
376378
return DummyCmd()
377379

378380
engine.run = fake_run # type: ignore[assignment]

0 commit comments

Comments
 (0)