Skip to content

Commit 46f9889

Browse files
authored
[V1] Fix model parameterization for structured output tests (#14833)
Signed-off-by: Russell Bryant <[email protected]>
1 parent fe66b34 commit 46f9889

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

tests/v1/entrypoints/llm/test_struct_output_generate.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,15 @@
1414
from vllm.sampling_params import GuidedDecodingParams, SamplingParams
1515

1616
GUIDED_DECODING_BACKENDS_V1 = ["xgrammar"]
17-
18-
19-
@pytest.fixture
20-
def model_name():
21-
return [
22-
"Qwen/Qwen2.5-1.5B-Instruct", "mistralai/Ministral-8B-Instruct-2410"
23-
]
17+
MODELS_TO_TEST = [
18+
"Qwen/Qwen2.5-1.5B-Instruct", "mistralai/Ministral-8B-Instruct-2410"
19+
]
2420

2521

2622
@pytest.mark.skip_global_cleanup
2723
@pytest.mark.parametrize("guided_decoding_backend",
2824
GUIDED_DECODING_BACKENDS_V1)
25+
@pytest.mark.parametrize("model_name", MODELS_TO_TEST)
2926
def test_guided_json_completion(
3027
monkeypatch: pytest.MonkeyPatch,
3128
sample_json_schema: dict[str, Any],
@@ -63,6 +60,7 @@ def test_guided_json_completion(
6360
@pytest.mark.skip_global_cleanup
6461
@pytest.mark.parametrize("guided_decoding_backend",
6562
GUIDED_DECODING_BACKENDS_V1)
63+
@pytest.mark.parametrize("model_name", MODELS_TO_TEST)
6664
def test_guided_json_object(
6765
monkeypatch: pytest.MonkeyPatch,
6866
guided_decoding_backend: str,
@@ -101,6 +99,7 @@ def test_guided_json_object(
10199
@pytest.mark.skip_global_cleanup
102100
@pytest.mark.parametrize("guided_decoding_backend",
103101
GUIDED_DECODING_BACKENDS_V1)
102+
@pytest.mark.parametrize("model_name", MODELS_TO_TEST)
104103
def test_guided_json_unsupported_schema(
105104
monkeypatch: pytest.MonkeyPatch,
106105
unsupported_json_schema: dict[str, Any],
@@ -128,6 +127,7 @@ def test_guided_json_unsupported_schema(
128127
@pytest.mark.skip_global_cleanup
129128
@pytest.mark.parametrize("guided_decoding_backend",
130129
GUIDED_DECODING_BACKENDS_V1)
130+
@pytest.mark.parametrize("model_name", MODELS_TO_TEST)
131131
def test_guided_grammar_ebnf(
132132
monkeypatch: pytest.MonkeyPatch,
133133
sample_sql_ebnf: str,
@@ -170,6 +170,7 @@ def test_guided_grammar_ebnf(
170170
@pytest.mark.skip_global_cleanup
171171
@pytest.mark.parametrize("guided_decoding_backend",
172172
GUIDED_DECODING_BACKENDS_V1)
173+
@pytest.mark.parametrize("model_name", MODELS_TO_TEST)
173174
def test_guided_grammar_lark(
174175
monkeypatch: pytest.MonkeyPatch,
175176
sample_sql_lark: str,
@@ -217,6 +218,7 @@ def test_guided_grammar_lark(
217218
@pytest.mark.skip_global_cleanup
218219
@pytest.mark.parametrize("guided_decoding_backend",
219220
GUIDED_DECODING_BACKENDS_V1)
221+
@pytest.mark.parametrize("model_name", MODELS_TO_TEST)
220222
def test_guided_grammar_ebnf_invalid(
221223
monkeypatch: pytest.MonkeyPatch,
222224
guided_decoding_backend: str,
@@ -244,6 +246,7 @@ def test_guided_grammar_ebnf_invalid(
244246
@pytest.mark.skip_global_cleanup
245247
@pytest.mark.parametrize("guided_decoding_backend",
246248
GUIDED_DECODING_BACKENDS_V1)
249+
@pytest.mark.parametrize("model_name", MODELS_TO_TEST)
247250
def test_guided_regex(
248251
monkeypatch: pytest.MonkeyPatch,
249252
sample_regex: str,
@@ -280,6 +283,7 @@ def test_guided_regex(
280283
@pytest.mark.skip_global_cleanup
281284
@pytest.mark.parametrize("guided_decoding_backend",
282285
GUIDED_DECODING_BACKENDS_V1)
286+
@pytest.mark.parametrize("model_name", MODELS_TO_TEST)
283287
def test_guided_choice_completion(
284288
monkeypatch: pytest.MonkeyPatch,
285289
sample_guided_choice: str,

0 commit comments

Comments
 (0)