feature: scripts/export_run.py 用来导出运行结果

This commit is contained in:
baozaotumao2025
2026-07-18 23:28:13 +08:00
parent 14722be770
commit c57ec67fe3
7 changed files with 85 additions and 7 deletions
+12 -1
View File
@@ -2,7 +2,9 @@ from pathlib import Path
from runpy import run_path
render_markdown = run_path(Path(__file__).parents[1] / "scripts/export_run.py")["render_markdown"]
exports = run_path(Path(__file__).parents[1] / "scripts/export_run.py")
matches_result = exports["matches_result"]
render_markdown = exports["render_markdown"]
def test_render_markdown_contains_input_output_and_judgement():
@@ -24,3 +26,12 @@ def test_render_markdown_contains_input_output_and_judgement():
)
assert all(value in text for value in ["测试输入", "模型输出", "fail", "0.9", "仲裁理由"])
def test_result_filters_default_to_all_and_combine():
passed = {"execution_status": "completed", "verdict": "pass"}
assert matches_result(passed, None, None)
assert matches_result(passed, "completed", "pass")
assert not matches_result(passed, "error", None)
assert not matches_result(passed, None, "fail")