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:
co-authored by
Claude Opus 5
parent
804e5377aa
commit
8c1557a79c
@@ -43,7 +43,8 @@ def _system():
|
||||
|
||||
class TestResponseInputToHarmonyRenderParity:
|
||||
"""Each test drives the same conversation through both APIs and asserts
|
||||
identical Harmony messages and rendered token sequences."""
|
||||
identical Harmony messages and rendered token sequences.
|
||||
"""
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
# Single-message cases
|
||||
@@ -51,7 +52,8 @@ class TestResponseInputToHarmonyRenderParity:
|
||||
|
||||
def test_developer_message(self):
|
||||
"""Both APIs must render developer messages identically using
|
||||
DeveloperContent (with the '# Instructions' header)."""
|
||||
DeveloperContent (with the '# Instructions' header).
|
||||
"""
|
||||
chat_msgs = parse_chat_input_to_harmony_message(
|
||||
{"role": "developer", "content": "Be concise."}
|
||||
)
|
||||
@@ -246,7 +248,8 @@ class TestResponseInputToHarmonyRenderParity:
|
||||
def test_reasoning_combined_with_function_call(self):
|
||||
"""Chat API packs reasoning + tool_calls into one dict; responses API
|
||||
represents them as two separate items. Both must produce the same two
|
||||
Harmony messages in the same order: analysis then commentary."""
|
||||
Harmony messages in the same order: analysis then commentary.
|
||||
"""
|
||||
chat_msgs = parse_chat_input_to_harmony_message(
|
||||
{
|
||||
"role": "assistant",
|
||||
@@ -529,7 +532,8 @@ class TestResponseInputToHarmonyRenderParity:
|
||||
def test_completed_turns_drop_reasoning(self):
|
||||
"""Validates that reasoning from completed turns is dropped, while
|
||||
reasoning from the current in-progress tool-call turn is preserved
|
||||
in both chat completions and responses previous_input_messages."""
|
||||
in both chat completions and responses previous_input_messages.
|
||||
"""
|
||||
first_turn_reasoning = "FIRST_TURN_REASONING"
|
||||
second_turn_reasoning = "SECOND_TURN_REASONING"
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ class TestIsFunctionRecipientWithAllowedNames:
|
||||
"""Tests for is_function_recipient with allowed_function_tool_names."""
|
||||
|
||||
def test_prefixed_always_accepted(self):
|
||||
"""functions. prefix is always accepted regardless of allowed names."""
|
||||
"""Functions. prefix is always accepted regardless of allowed names."""
|
||||
fn_names = frozenset({"other_tool"})
|
||||
assert is_function_recipient("functions.get_weather", fn_names) is True
|
||||
|
||||
@@ -252,8 +252,7 @@ class TestExtractFunctionFromRecipient:
|
||||
|
||||
|
||||
class TestCommonParseInputToHarmonyMessage:
|
||||
"""
|
||||
Tests for scenarios that are common to both Chat Completion
|
||||
"""Tests for scenarios that are common to both Chat Completion
|
||||
parse_chat_input_to_harmony_message and Responses API
|
||||
response_previous_input_to_harmony functions.
|
||||
"""
|
||||
@@ -324,7 +323,8 @@ class TestCommonParseInputToHarmonyMessage:
|
||||
|
||||
def test_system_message(self, parse_function):
|
||||
"""Test parsing system messages, which are parsed into developer messages
|
||||
with DeveloperContent."""
|
||||
with DeveloperContent.
|
||||
"""
|
||||
chat_msg = {
|
||||
"role": "system",
|
||||
"content": "You are a helpful assistant",
|
||||
@@ -448,8 +448,7 @@ class TestCommonParseInputToHarmonyMessage:
|
||||
|
||||
|
||||
class TestParseChatInputToHarmonyMessage:
|
||||
"""
|
||||
Tests for scenarios that are specific to the Chat Completion API
|
||||
"""Tests for scenarios that are specific to the Chat Completion API
|
||||
parse_chat_input_to_harmony_message function.
|
||||
"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user