refactor(cli): 移动CliRunner到顶层runner模块并清理冗余代码

This commit is contained in:
2026-06-20 17:35:24 +08:00
parent 13f6110b18
commit 6cc693d15f
11 changed files with 304 additions and 681 deletions
+3 -3
View File
@@ -491,7 +491,7 @@ class TestCliRunnerErrorHandling:
def raise_interrupt(*args: Any, **kwargs: Any) -> None:
raise KeyboardInterrupt
with patch("pyflowx.cli.runner.run", side_effect=raise_interrupt):
with patch("pyflowx.runner.run", side_effect=raise_interrupt):
exit_code = runner.run(["echo"])
assert exit_code == CliExitCode.INTERRUPTED.value
captured = capsys.readouterr()
@@ -506,7 +506,7 @@ class TestCliRunnerErrorHandling:
def raise_error(*args: Any, **kwargs: Any) -> None:
raise TaskFailedError("echo", RuntimeError("boom"), 1)
with patch("pyflowx.cli.runner.run", side_effect=raise_error):
with patch("pyflowx.runner.run", side_effect=raise_error):
exit_code = runner.run(["echo"])
assert exit_code == CliExitCode.FAILURE.value
captured = capsys.readouterr()
@@ -523,7 +523,7 @@ class TestCliRunnerErrorHandling:
def raise_custom(*args: Any, **kwargs: Any) -> None:
raise CustomError("unexpected")
with patch("pyflowx.cli.runner.run", side_effect=raise_custom):
with patch("pyflowx.runner.run", side_effect=raise_custom):
with pytest.raises(CustomError):
runner.run(["echo"])