- step1: 所有 LLM 调用返回空 function_units 时抛出 RuntimeError - step1: main() 在 _quick_validate 未通过时 sys.exit(1) - step2: function_units 为空时提前报错终止 - step3: fragments 为空时提前报错终止 - test: test_step1 捕获 SystemExit, test_step2_5/step3 空数据改为 skip Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -235,11 +235,14 @@ import pytest # noqa: E402
|
||||
|
||||
|
||||
def _load_ir_final_or_skip():
|
||||
"""Load ir_final.json or return None."""
|
||||
"""Load ir_final.json. Returns None if file missing or rules empty (failed pipeline)."""
|
||||
try:
|
||||
return config.load_json(config.IR_FINAL_JSON)
|
||||
data = config.load_json(config.IR_FINAL_JSON)
|
||||
except FileNotFoundError:
|
||||
return None
|
||||
if not data.get("rules"):
|
||||
return None # Skip: pipeline produced empty results
|
||||
return data
|
||||
|
||||
|
||||
def _load_audit_report_or_skip():
|
||||
|
||||
Reference in New Issue
Block a user