From c8e9354e87903facfbbb84e6afccd915f20c8276 Mon Sep 17 00:00:00 2001 From: gooker_young Date: Sun, 21 Jun 2026 19:07:47 +0800 Subject: [PATCH] =?UTF-8?q?fix(runner):=20=E4=BF=AE=E5=A4=8D=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E8=A1=8C=E7=AD=96=E7=95=A5=E9=BB=98=E8=AE=A4=E5=80=BC?= =?UTF-8?q?=E4=B8=8E=E6=9E=84=E9=80=A0=E5=8F=82=E6=95=B0=E4=B8=8D=E4=B8=80?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pyflowx/runner.py | 2 +- tests/test_runner.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pyflowx/runner.py b/src/pyflowx/runner.py index 039f350..e80cc42 100644 --- a/src/pyflowx/runner.py +++ b/src/pyflowx/runner.py @@ -161,7 +161,7 @@ class CliRunner: _ = parser.add_argument( "--strategy", choices=list(get_args(Strategy)), - default="sequential", + default=self.strategy, help="执行策略 (默认: %(default)s)", ) _ = parser.add_argument( diff --git a/tests/test_runner.py b/tests/test_runner.py index f40e983..6be2d69 100644 --- a/tests/test_runner.py +++ b/tests/test_runner.py @@ -167,10 +167,10 @@ class TestCliRunnerParser: def test_parser_strategy_default(self) -> None: """--strategy 默认值应与构造时一致.""" - runner = px.CliRunner({"clean": _echo_graph()}, "async") + runner = px.CliRunner({"clean": _echo_graph()}, strategy="async") parser = runner.create_parser() parsed = parser.parse_args(["clean"]) - assert parsed.strategy == "sequential" + assert parsed.strategy == "async" def test_parser_has_dry_run_flag(self) -> None: """解析器应有 --dry-run 标志."""