Skip to content

Commit 6acaa25

Browse files
Fix CI: remove extra blank lines and unnecessary pragma comments
Remove extra blank line before _SIMPLE_TYPES and between test functions to satisfy pre-commit linting. Remove # pragma: no cover from test inner functions that are exercised by the tests.
1 parent 40e6cbf commit 6acaa25

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

src/mcp/server/mcpserver/utilities/func_metadata.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,6 @@ def _try_create_model_and_schema(
416416
return None, None, False
417417

418418

419-
420419
_SIMPLE_TYPES: frozenset[type] = frozenset({str, int, float, bool, type(None)})
421420

422421

tests/server/mcpserver/test_func_metadata.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,6 @@ def handle_json_payload(payload: str, strict_mode: bool = False) -> str:
551551
assert result == f"Handled payload of length {len(json_array_payload)}"
552552

553553

554-
555554
def test_str_union_pre_parse_preserves_strings():
556555
"""Regression test for #1873: pre_parse_json must not JSON-parse strings
557556
when the annotation is a union of simple types like str | None.
@@ -560,7 +559,7 @@ def test_str_union_pre_parse_preserves_strings():
560559
corrupted because json.loads would partially parse them as numbers.
561560
"""
562561

563-
def func_optional_str(value: str | None = None) -> str: # pragma: no cover
562+
def func_optional_str(value: str | None = None) -> str:
564563
return str(value)
565564

566565
meta = func_metadata(func_optional_str)
@@ -590,7 +589,7 @@ def test_complex_union_still_pre_parses():
590589
JSON pre-parsing so that serialized lists are deserialized properly.
591590
"""
592591

593-
def func_optional_list(items: list[str] | None = None) -> str: # pragma: no cover
592+
def func_optional_list(items: list[str] | None = None) -> str:
594593
return str(items)
595594

596595
meta = func_metadata(func_optional_list)
@@ -601,7 +600,7 @@ def func_optional_list(items: list[str] | None = None) -> str: # pragma: no cov
601600
async def test_str_union_uuid_end_to_end():
602601
"""End-to-end test: a str | None parameter receives the exact UUID string."""
603602

604-
def update_task(task_id: str | None = None) -> str: # pragma: no cover
603+
def update_task(task_id: str | None = None) -> str:
605604
return f"got {task_id}"
606605

607606
meta = func_metadata(update_task)

0 commit comments

Comments
 (0)