Skip to content

Commit d8f93b3

Browse files
committed
test(models): re-enable finish_reason unknown-maps-to-OTHER litellm test
test_finish_reason_unknown_maps_to_other was skipped during the v2.0.0 GA transition with reason "LiteLLM finish_reason mapping behaviour changed". That reason is now stale: _map_finish_reason ends with _FINISH_REASON_MAPPING.get(finish_reason_str, types.FinishReason.OTHER), so any unmapped finish_reason deterministically maps to OTHER regardless of LiteLLM's own normalization. The test bypasses that normalization with a mock returning a raw "totally_unknown_reason" and asserts the OTHER fallback. This skipped test is the only coverage of the _map_finish_reason -> OTHER fallback branch in the litellm suite, so the skip left a live production branch untested. Removing the skip restores that coverage with no production change; the test passes as-is.
1 parent e6df097 commit d8f93b3

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

tests/unittests/models/test_litellm.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4984,7 +4984,6 @@ def test_model_response_to_generate_content_response_safety_finish_reason():
49844984
assert llm_response.error_message == "Finished with SAFETY"
49854985

49864986

4987-
@pytest.mark.skip(reason="LiteLLM finish_reason mapping behaviour changed")
49884987
@pytest.mark.asyncio
49894988
async def test_finish_reason_unknown_maps_to_other(
49904989
mock_acompletion, lite_llm_instance

0 commit comments

Comments
 (0)