style: apply ruff format to T6 inference aggregation

This commit is contained in:
2026-07-15 06:58:51 -04:00
parent 730caa7e9a
commit 61bfa0e633
+3 -9
View File
@@ -268,9 +268,7 @@ class TestRunInferencePairEndToEnd:
"""run_inference pair 端到端:逐题落库不变 + unit 级聚合。""" """run_inference pair 端到端:逐题落库不变 + unit 级聚合。"""
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_pair_predictions_persisted_per_question( async def test_pair_predictions_persisted_per_question(self, harness_log: HarnessLog) -> None:
self, harness_log: HarnessLog
) -> None:
"""pair 两题各自逐题落 predictions(保留逐题溯源),聚合按 unit。""" """pair 两题各自逐题落 predictions(保留逐题溯源),聚合按 unit。"""
llm = AsyncMock() llm = AsyncMock()
llm.chat.return_value = _make_llm_response(answer="B") llm.chat.return_value = _make_llm_response(answer="B")
@@ -301,18 +299,14 @@ class TestRunInferencePairEndToEnd:
assert qids == {"po", "pm"} assert qids == {"po", "pm"}
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_orphan_pair_excluded_single_survives( async def test_orphan_pair_excluded_single_survives(self, harness_log: HarnessLog) -> None:
self, harness_log: HarnessLog
) -> None:
"""run_inference 中孤儿 pair 被剔除、single 仍计入。""" """run_inference 中孤儿 pair 被剔除、single 仍计入。"""
llm = AsyncMock() llm = AsyncMock()
llm.chat.return_value = _make_llm_response(answer="B") llm.chat.return_value = _make_llm_response(answer="B")
questions = [ questions = [
_make_question("s1", answer="B"), _make_question("s1", answer="B"),
_make_question( _make_question("po", answer="B", pair_id="orphan", question_role="pair_original"),
"po", answer="B", pair_id="orphan", question_role="pair_original"
),
] ]
result = await run_inference( result = await run_inference(
questions, questions,