From 20802c7fe6233cac2707fe528de0f56b2ce0eb18 Mon Sep 17 00:00:00 2001 From: Zhichenzzz Date: Wed, 26 Aug 2026 23:24:20 -0700 Subject: [PATCH] test(dsv4): accept both sglang reasoning-effort validation behaviors CI runners carry different sglang versions: older ones assert the allowed set (AssertionError: Invalid reasoning effort: ultra), newer ones raise ValueError with the same message. Pin the message, not the exception type. --- tests/fast/utils/chat_template_utils/test_deepseek_v4.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/fast/utils/chat_template_utils/test_deepseek_v4.py b/tests/fast/utils/chat_template_utils/test_deepseek_v4.py index 63c3559fe6e..40b59a423ea 100644 --- a/tests/fast/utils/chat_template_utils/test_deepseek_v4.py +++ b/tests/fast/utils/chat_template_utils/test_deepseek_v4.py @@ -200,8 +200,10 @@ def test_reasoning_effort_high_accepted_and_matches_direct(): def test_reasoning_effort_invalid_value_raises(): - # Value-level validation is delegated to sglang (asserts the allowed set). - with pytest.raises(AssertionError): + # Value-level validation is delegated to sglang; depending on the sglang + # version it asserts the allowed set or raises ValueError. Both carry the + # same "Invalid reasoning effort" message. + with pytest.raises((AssertionError, ValueError), match="Invalid reasoning effort"): deepseek.V4.render_messages(_MSGS_BASIC, thinking_mode="thinking", reasoning_effort="ultra")