fastmcp/tests/tools/tool/_pep563_none_fixture.py
marvin-context-protocol[bot] 4d4c91bc95 Publish FastMCP v4.2.6 docs
2026-11-25 02:55:23 +00:00

25 lines
538 B
Python

"""Fixtures with real PEP 563 (``from __future__ import annotations``).
Do not strip the future import: it is what makes return annotations stored as
strings, so ``get_type_hints`` resolves ``-> None`` to the ``NoneType`` class.
"""
from __future__ import annotations
from mcp_types import InputRequiredResult
def do_nothing() -> None:
return None
async def do_nothing_async() -> None:
return None
async def do_nothing_guarded_async() -> InputRequiredResult | None:
return None
def give_int() -> int:
return 42