chore: add D212 lint rule to enforce Google-style docstrings (#1892)

This commit is contained in:
Felix Weinberger 2026-01-16 16:10:52 +00:00 • committed by GitHub
commit d41d0c0128
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 452 additions and 925 deletions

View file

@ -129,8 +129,7 @@ async def test_request_cancellation():
@pytest.mark.anyio
async def test_response_id_type_mismatch_string_to_int():
"""
Test that responses with string IDs are correctly matched to requests sent with
"""Test that responses with string IDs are correctly matched to requests sent with
integer IDs.
This handles the case where a server returns "id": "0" (string) but the client
@ -185,8 +184,7 @@ async def test_response_id_type_mismatch_string_to_int():
@pytest.mark.anyio
async def test_error_response_id_type_mismatch_string_to_int():
"""
Test that error responses with string IDs are correctly matched to requests
"""Test that error responses with string IDs are correctly matched to requests
sent with integer IDs.
This handles the case where a server returns an error with "id": "0" (string)
@ -242,8 +240,7 @@ async def test_error_response_id_type_mismatch_string_to_int():
@pytest.mark.anyio
async def test_response_id_non_numeric_string_no_match():
"""
Test that responses with non-numeric string IDs don't incorrectly match
"""Test that responses with non-numeric string IDs don't incorrectly match
integer request IDs.
If a server returns "id": "abc" (non-numeric string), it should not match
@ -295,9 +292,7 @@ async def test_response_id_non_numeric_string_no_match():
@pytest.mark.anyio
async def test_connection_closed():
"""
Test that pending requests are cancelled when the connection is closed remotely.
"""
"""Test that pending requests are cancelled when the connection is closed remotely."""
ev_closed = anyio.Event()
ev_response = anyio.Event()

View file

@ -1,5 +1,4 @@
"""
Tests for the StreamableHTTP server and client transport.
"""Tests for the StreamableHTTP server and client transport.
Contains tests for both server and client sides of the StreamableHTTP transport.
"""
@ -2184,8 +2183,7 @@ async def test_streamable_http_multiple_reconnections(
async def test_standalone_get_stream_reconnection(
event_server: tuple[SimpleEventStore, str],
) -> None:
"""
Test that standalone GET stream automatically reconnects after server closes it.
"""Test that standalone GET stream automatically reconnects after server closes it.
Verifies:
1. Client receives notification 1 via GET stream