From 93103575ce0480f36fc1a3603eb51d9a89f38a00 Mon Sep 17 00:00:00 2001 From: rasmith Date: Fri, 14 Nov 2025 00:41:29 -0600 Subject: [PATCH] [BugFix][CI/Build][ROCM] Fix import error and apply assert in appropriate case in test_struct_output_generate (#28311) Signed-off-by: Randall Smith Co-authored-by: Randall Smith --- .../v1/entrypoints/llm/test_struct_output_generate.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/v1/entrypoints/llm/test_struct_output_generate.py b/tests/v1/entrypoints/llm/test_struct_output_generate.py index 4cd26e7b41d3..a7d769c8542a 100644 --- a/tests/v1/entrypoints/llm/test_struct_output_generate.py +++ b/tests/v1/entrypoints/llm/test_struct_output_generate.py @@ -677,9 +677,14 @@ def test_structured_output_with_reasoning_matrices( reasoning, content = run_reasoning_extraction(reasoner, [generated_text]) print(f"Prompt: {prompt!r}\nReasoning: {reasoning!r}\nContent: {content!r}") - assert content is not None and reasoning is not None - output_json = json.loads(content) - jsonschema.validate(instance=output_json, schema=reasoning_schema) + if "Qwen3" in model_name: + assert content is not None + + assert reasoning is not None + + if content is not None: + output_json = json.loads(content) + jsonschema.validate(instance=output_json, schema=reasoning_schema) @pytest.mark.skip_global_cleanup