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
+1 -2
View File
@@ -166,8 +166,7 @@ async def test_chat_completion_with_tools(
async def test_response_format_with_tool_choice_required(
client: openai.AsyncOpenAI, server_config: ServerConfig
):
"""
Test that combining response_format: json_object with tool_choice: required
"""Test that combining response_format: json_object with tool_choice: required
doesn't crash the engine.
Before the fix, this would cause a validation error:
@@ -171,7 +171,7 @@ def test_tool_parser_adjust_request_builds_valid_response_text_config() -> None:
def test_gemma4_required_skips_structured_outputs_chatcompletion() -> None:
"""required + ChatCompletion: ``Gemma4EngineToolParser`` must skip the
"""Required + ChatCompletion: ``Gemma4EngineToolParser`` must skip the
forced JSON ``structured_outputs`` so the model emits its native
``<|tool_call>`` syntax. The base parser constrained output to JSON the
native parser cannot read, leaking it as content with empty
@@ -187,7 +187,7 @@ def test_gemma4_required_skips_structured_outputs_chatcompletion() -> None:
def test_gemma4_named_skips_structured_outputs_chatcompletion() -> None:
"""named + ChatCompletion: the forced single-function JSON schema must be
"""Named + ChatCompletion: the forced single-function JSON schema must be
skipped, same as ``required``.
"""
parser = Gemma4ToolParser(_StubTokenizer())
@@ -202,7 +202,7 @@ def test_gemma4_named_skips_structured_outputs_chatcompletion() -> None:
def test_gemma4_required_skips_structured_outputs_responses() -> None:
"""required + Responses: the forced JSON schema (``request.text``) must be
"""Required + Responses: the forced JSON schema (``request.text``) must be
skipped so the native delimiters reach the extractor.
"""
parser = Gemma4ToolParser(_StubTokenizer())
@@ -215,7 +215,7 @@ def test_gemma4_required_skips_structured_outputs_responses() -> None:
def test_gemma4_named_skips_structured_outputs_responses() -> None:
"""named (``ToolChoiceFunction``) + Responses: the forced single-function
"""Named (``ToolChoiceFunction``) + Responses: the forced single-function
JSON schema must be skipped.
"""
parser = Gemma4ToolParser(_StubTokenizer())
@@ -230,7 +230,7 @@ def test_gemma4_named_skips_structured_outputs_responses() -> None:
def test_gemma4_keeps_special_tokens_with_tools_thinking_disabled() -> None:
"""tools active + thinking disabled: ``skip_special_tokens`` must stay
"""Tools active + thinking disabled: ``skip_special_tokens`` must stay
False so ``<|tool_call>`` delimiters reach the extractor. The merged
enable_thinking early-return stripped them, breaking tool calling when
thinking is off.
+2 -1
View File
@@ -220,7 +220,8 @@ def test_reasoning_then_parallel_calls():
def _stream(raw: str, chunk: int):
"""Feed ``raw`` incrementally in ``chunk``-char steps through BOTH streaming
parsers; return (reasoning, content, tool_calls)."""
parsers; return (reasoning, content, tool_calls).
"""
reasoning, content, toolcalls = [], [], []
prev = ""
i = 0
+1 -4
View File
@@ -237,10 +237,7 @@ async def test_parallel_tool_calls_with_results(
async def test_parallel_tool_calls_false(
client: openai.AsyncOpenAI, server_config: ServerConfig
):
"""
Ensure only one tool call is returned when parallel_tool_calls is False.
"""
"""Ensure only one tool call is returned when parallel_tool_calls is False."""
models = await client.models.list()
model_name: str = models.data[0].id
messages = apply_parallel_tool_system_prompt(
+2 -1
View File
@@ -376,7 +376,8 @@ WEB_SEARCH_TOOL = WebSearchTool(type="web_search")
class TestNonFunctionToolsSkipped:
"""Non-function tools (web_search, etc.) must be silently skipped
by the tool-schema utilities instead of raising TypeError."""
by the tool-schema utilities instead of raising TypeError.
"""
def test_find_tool_properties_skips_web_search(self):
tools = [WEB_SEARCH_TOOL, FUNCTION_TOOL]