refactor: 重构执行器和CliRunner,简化策略类型实现
1. 将Strategy枚举改为Literal类型,移除normalize_strategy函数 2. 内联策略验证逻辑到run函数中 3. 使用dataclasses.field重构CliRunner的初始化方式 4. 修复测试用例中的函数名和调用方式不匹配问题 5. 调整部分测试用例的构造语法,适配新的API 6. 修正pymake模块中的函数重命名和条件变量命名问题 7. 为部分耗时测试添加@pytest.mark.slow标记
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"""Tests for pymake CLI."""
|
||||
|
||||
from pyflowx.cli.pymake import _get_maturin_build_command, build_graphs, conf
|
||||
from pyflowx.cli.pymake import build_graphs, conf, get_maturin_build_command
|
||||
|
||||
|
||||
def test_pymake_config_attributes():
|
||||
@@ -23,8 +23,8 @@ def test_pymake_config_values():
|
||||
|
||||
|
||||
def test_get_maturin_build_command_basic():
|
||||
"""Test _get_maturin_build_command returns base command."""
|
||||
cmd = _get_maturin_build_command()
|
||||
"""Test get_maturin_build_command returns base command."""
|
||||
cmd = get_maturin_build_command()
|
||||
assert "maturin" in cmd
|
||||
assert "build" in cmd
|
||||
assert "-r" in cmd
|
||||
@@ -97,7 +97,7 @@ def test_maturin_build_command_graph_structure():
|
||||
specs = graph.all_specs()
|
||||
assert len(specs) == 1
|
||||
spec = graph.spec("maturin_build")
|
||||
assert spec.cmd == _get_maturin_build_command()
|
||||
assert spec.cmd == get_maturin_build_command()
|
||||
|
||||
|
||||
def test_install_all_command_graph_structure():
|
||||
|
||||
Reference in New Issue
Block a user