Skip to content

Commit 8191305

Browse files
Add pragma: no cover to inner test functions not executed by coverage
The inner functions func_optional_str and func_optional_list are only used for metadata extraction and pre_parse_json testing -- their bodies are never actually called, so coverage cannot track them.
1 parent 6acaa25 commit 8191305

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/server/mcpserver/test_func_metadata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ def test_str_union_pre_parse_preserves_strings():
559559
corrupted because json.loads would partially parse them as numbers.
560560
"""
561561

562-
def func_optional_str(value: str | None = None) -> str:
562+
def func_optional_str(value: str | None = None) -> str: # pragma: no cover
563563
return str(value)
564564

565565
meta = func_metadata(func_optional_str)
@@ -589,7 +589,7 @@ def test_complex_union_still_pre_parses():
589589
JSON pre-parsing so that serialized lists are deserialized properly.
590590
"""
591591

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

595595
meta = func_metadata(func_optional_list)

0 commit comments

Comments
 (0)