fix: converge non-numeric selector scores to ValueError
This commit is contained in:
@@ -63,6 +63,14 @@ async def test_generate_pool_degrades_on_malformed_response():
|
||||
assert out == []
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_score_options_raises_valueerror_on_non_numeric():
|
||||
from app.question_gen.distractor_selector import _score_options
|
||||
vlm = _FakeVLM(['{"scores": [0.9, null, 0.5]}']) # null 不是数值
|
||||
with pytest.raises(ValueError):
|
||||
await _score_options(vlm, "?", ["蒸", "炒", "煮"], _Material(), session_id="s")
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_build_grounded_options_happy_path():
|
||||
pool = '{"distractors": ["炒", "煮", "炸", "烤"]}'
|
||||
|
||||
Reference in New Issue
Block a user