Add pydocstyle to the ruff rules (#52136)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <hej.mellor@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Harry Mellor
2026-09-16 16:44:29 +00:00
committed by GitHub
co-authored by Claude Opus 5
parent 804e5377aa
commit 8c1557a79c
2002 changed files with 15024 additions and 14269 deletions
@@ -29,7 +29,8 @@ class _StubModelConfig:
def test_structured_outputs_rejected_for_diffusion_models():
"""Diffusion LLMs denoise the canvas in parallel, which is incompatible
with the token-by-token grammar FSM. The request must fail with a clear
validation error instead of an FSM rejection mid-generation (#45436)."""
validation error instead of an FSM rejection mid-generation (#45436).
"""
params = SamplingParams(
structured_outputs=StructuredOutputsParams(json=JSON_SCHEMA)
)
@@ -62,7 +63,8 @@ def test_degenerate_structured_outputs_rejected(structured_outputs, match):
"""json_object=False and an empty json schema pass the `is not None`
exclusivity check but resolve to no structured-output key, so they must be
rejected at request validation (-> 400) instead of reaching and crashing
the engine."""
the engine.
"""
params = SamplingParams(structured_outputs=structured_outputs)
with pytest.raises(VLLMValidationError, match=match):
params._validate_structured_outputs(
@@ -85,7 +87,8 @@ def test_regex_with_nul_byte_rejected(regex):
handled by xgrammar's native regex converter. It must be rejected at request
validation in every backend mode (a clean 400), instead of reaching that
native code or silently falling back to another backend in the default
'auto' mode."""
'auto' mode.
"""
params = SamplingParams(structured_outputs=StructuredOutputsParams(regex=regex))
# Rejected before backend selection, so it is a 400 even in 'auto' mode
@@ -124,7 +127,8 @@ INVALID_JSON_SCHEMA = {"type": "object", "properties": {"name": {"type": "str"}}
)
def test_unsupported_grammar_is_a_client_error(backend, structured_outputs):
"""Only `VLLMClientError` survives `AsyncLLM.generate` untouched; anything else
is wrapped in `EngineGenerateError` and served as a 500 instead of a 400."""
is wrapped in `EngineGenerateError` and served as a 500 instead of a 400.
"""
params = SamplingParams(structured_outputs=structured_outputs)
with pytest.raises(VLLMClientError):
params._validate_structured_outputs(