Disable mypy arg-type and assignment checks in tests (#59428)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
17e9295dd5
commit
fc2c801ad9
@@ -35,7 +35,7 @@ def test_structured_outputs_rejected_for_diffusion_models():
|
||||
)
|
||||
with pytest.raises(VLLMValidationError, match="not yet supported for diffusion"):
|
||||
params._validate_structured_outputs(
|
||||
_StubModelConfig(is_diffusion=True), # type: ignore[arg-type]
|
||||
_StubModelConfig(is_diffusion=True),
|
||||
StructuredOutputsConfig(),
|
||||
tokenizer=None,
|
||||
)
|
||||
@@ -45,7 +45,7 @@ def test_plain_request_allowed_for_diffusion_models():
|
||||
"""Requests without structured outputs are unaffected by the guard."""
|
||||
params = SamplingParams()
|
||||
params._validate_structured_outputs(
|
||||
_StubModelConfig(is_diffusion=True), # type: ignore[arg-type]
|
||||
_StubModelConfig(is_diffusion=True),
|
||||
StructuredOutputsConfig(),
|
||||
tokenizer=None,
|
||||
)
|
||||
@@ -71,9 +71,9 @@ def test_degenerate_structured_outputs_rejected(structured_outputs, match):
|
||||
params = SamplingParams(structured_outputs=structured_outputs)
|
||||
with pytest.raises(VLLMValidationError, match=match):
|
||||
params._validate_structured_outputs(
|
||||
_StubModelConfig(is_diffusion=False), # type: ignore[arg-type]
|
||||
_StubModelConfig(is_diffusion=False),
|
||||
StructuredOutputsConfig(),
|
||||
tokenizer=object(), # type: ignore[arg-type]
|
||||
tokenizer=object(),
|
||||
)
|
||||
|
||||
|
||||
@@ -97,9 +97,9 @@ def test_regex_with_nul_byte_rejected(regex):
|
||||
# (which would otherwise catch the error and fall back to another backend).
|
||||
with pytest.raises(VLLMValidationError, match="NUL"):
|
||||
params._validate_structured_outputs(
|
||||
_StubModelConfig(is_diffusion=False), # type: ignore[arg-type]
|
||||
_StubModelConfig(is_diffusion=False),
|
||||
StructuredOutputsConfig(),
|
||||
tokenizer=object(), # type: ignore[arg-type]
|
||||
tokenizer=object(),
|
||||
)
|
||||
|
||||
# The xgrammar backend also rejects it directly (defense in depth), before
|
||||
@@ -133,9 +133,9 @@ def test_unsupported_grammar_is_a_client_error(backend, structured_outputs):
|
||||
params = SamplingParams(structured_outputs=structured_outputs)
|
||||
with pytest.raises(VLLMClientError):
|
||||
params._validate_structured_outputs(
|
||||
_StubModelConfig(is_diffusion=False), # type: ignore[arg-type]
|
||||
_StubModelConfig(is_diffusion=False),
|
||||
StructuredOutputsConfig(backend=backend),
|
||||
tokenizer=object(), # type: ignore[arg-type]
|
||||
tokenizer=object(),
|
||||
)
|
||||
|
||||
|
||||
@@ -180,9 +180,9 @@ def test_auto_backend_falls_back_on_unsupported_schema(schema, expected_backend)
|
||||
"""`auto` falls back on rejection, so it must catch what the validators raise."""
|
||||
params = SamplingParams(structured_outputs=StructuredOutputsParams(json=schema))
|
||||
params._validate_structured_outputs(
|
||||
_StubModelConfig(is_diffusion=False), # type: ignore[arg-type]
|
||||
_StubModelConfig(is_diffusion=False),
|
||||
StructuredOutputsConfig(backend="auto"),
|
||||
tokenizer=object(), # type: ignore[arg-type]
|
||||
tokenizer=object(),
|
||||
)
|
||||
assert params.structured_outputs is not None
|
||||
assert params.structured_outputs._backend == expected_backend
|
||||
|
||||
Reference in New Issue
Block a user