feat: --retry-uncertain re-diagnoses uncertain rows; fix docstring
This commit is contained in:
@@ -85,6 +85,33 @@ def test_null_fields_for_infra_row(tmp_path):
|
||||
assert rows[0].error_type is None and rows[0].evolution_target is None and rows[0].infra is True
|
||||
|
||||
|
||||
def test_done_question_ids_retry_uncertain_excludes(tmp_path):
|
||||
"""retry_uncertain=True 时 uncertain 题不算完成(会被重诊),非 uncertain 仍算完成。"""
|
||||
s = _store(tmp_path)
|
||||
# T2(defect)题:已完成
|
||||
s.upsert(
|
||||
DiagnosisSignalRow(
|
||||
"t2_qid", "v1", "run", "fp", "Counting",
|
||||
"search_failure", "defect", "T2", "skill",
|
||||
degraded=False, infra=False, session_id="s",
|
||||
)
|
||||
)
|
||||
# uncertain(degraded)题:信号不可信
|
||||
s.upsert(
|
||||
DiagnosisSignalRow(
|
||||
"uncertain_qid", "v2", "run", "fp", "Counting",
|
||||
None, None, "uncertain", None,
|
||||
degraded=True, infra=False, session_id=None,
|
||||
)
|
||||
)
|
||||
# 默认:两者都算完成
|
||||
assert s.done_question_ids("run", "fp") == {"t2_qid", "uncertain_qid"}
|
||||
# retry_uncertain:uncertain 被排除,T2 仍算完成
|
||||
done = s.done_question_ids("run", "fp", retry_uncertain=True)
|
||||
assert "uncertain_qid" not in done
|
||||
assert "t2_qid" in done
|
||||
|
||||
|
||||
def test_context_manager_closes_connection(tmp_path):
|
||||
# with 块退出后连接关闭,再操作应报 ProgrammingError
|
||||
with SqliteDiagnosisSignalStore(str(tmp_path / "h.db")) as s:
|
||||
|
||||
Reference in New Issue
Block a user