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
@@ -454,7 +454,8 @@ async def test_derender_completion_empty_generate_responses(client):
|
||||
@pytest.mark.asyncio
|
||||
async def test_derender_completion_logprobs(client):
|
||||
"""token_id:N placeholders in logprobs are resolved; CompletionLogProbs
|
||||
flat-list structure is returned with non-empty tokens and text_offsets."""
|
||||
flat-list structure is returned with non-empty tokens and text_offsets.
|
||||
"""
|
||||
gr1 = await _render_completion(client, "Hello world")
|
||||
ids1 = gr1["token_ids"][:3]
|
||||
token_id = ids1[0]
|
||||
@@ -555,7 +556,7 @@ async def test_derender_chat_oversized_token_ids_rejected(client):
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_derender_chat_too_many_choices_rejected(client):
|
||||
"""choices count exceeding VLLM_MAX_N_SEQUENCES returns 400."""
|
||||
"""Choices count exceeding VLLM_MAX_N_SEQUENCES returns 400."""
|
||||
# Default VLLM_MAX_N_SEQUENCES is 16384; use a larger count.
|
||||
oversized_choices = [
|
||||
{"index": i, "token_ids": [42], "finish_reason": "stop"} for i in range(20_000)
|
||||
|
||||
@@ -121,7 +121,8 @@ async def _disagg(
|
||||
|
||||
def _tool_sig(response_choice: dict) -> list[tuple[str, dict]]:
|
||||
"""[(name, json normalized args)] so key ordering / whitespace don't
|
||||
cause false negatives."""
|
||||
cause false negatives.
|
||||
"""
|
||||
return [
|
||||
(tc["function"]["name"], json.loads(tc["function"]["arguments"]))
|
||||
for tc in (response_choice["message"].get("tool_calls") or [])
|
||||
@@ -143,7 +144,8 @@ async def _run_parity_case(
|
||||
client: httpx.AsyncClient, messages: list[dict], **extra
|
||||
) -> tuple[dict, dict]:
|
||||
"""Run the coupled request then feed its generated tokens into the
|
||||
disaggregated derender endpoint. Returns (coupled, disagg)."""
|
||||
disaggregated derender endpoint. Returns (coupled, disagg).
|
||||
"""
|
||||
coupled = await _coupled(client, messages, **extra)
|
||||
ch = coupled["choices"][0]
|
||||
chat_request = {"model": MODEL, "messages": messages, **extra}
|
||||
@@ -203,7 +205,8 @@ async def test_parity_tool_call(client):
|
||||
@pytest.mark.asyncio
|
||||
async def test_parity_reasoning_and_tool_call(client):
|
||||
"""Combined reasoning + tool call parity means the highest drift risk
|
||||
since it exercises both parser branches on the same output."""
|
||||
since it exercises both parser branches on the same output.
|
||||
"""
|
||||
messages = [{"role": "user", "content": "What's the weather in Paris?"}]
|
||||
coupled, disagg = await _run_parity_case(
|
||||
client,
|
||||
|
||||
@@ -41,7 +41,6 @@ def _make_stream_chunk(
|
||||
usage: dict | None = None,
|
||||
) -> GenerateStreamResponse:
|
||||
"""Build a GenerateStreamResponse SSE chunk."""
|
||||
|
||||
return GenerateStreamResponse(
|
||||
request_id=request_id,
|
||||
choices=[
|
||||
@@ -61,7 +60,6 @@ def _make_usage_chunk(
|
||||
request_id: str = "test-req",
|
||||
) -> GenerateStreamResponse:
|
||||
"""Build a usage only final SSE chunk (empty choices)."""
|
||||
|
||||
return GenerateStreamResponse(
|
||||
request_id=request_id,
|
||||
choices=[],
|
||||
@@ -531,7 +529,6 @@ async def client(server):
|
||||
|
||||
async def _render_chat(client) -> dict:
|
||||
"""Render a minimal chat request and return the GenerateRequest dict."""
|
||||
|
||||
resp = await client.post(
|
||||
"/v1/chat/completions/render",
|
||||
json={
|
||||
|
||||
Reference in New Issue
Block a user