fastmcp/tests/utilities
William Easton e3f02374c7 Support functools.partial and centralize callable utilities
functools.partial objects failed at registration (@mcp.tool didn't
recognize them) and at call time (update_wrapper set __wrapped__
causing Pydantic to ignore bound arguments).

Introduces centralized utilities replacing scattered patterns across
11 files:

callable_utils.py:
- is_callable_object(): TypeGuard replacing inspect.isroutine() in
  7 decorator entry points — recognizes partials as callables
- get_callable_name(): Extracts useful names from any callable type,
  including partials without update_wrapper
- prepare_callable(): Strips __wrapped__, unwraps callable classes
  and staticmethod — replaces 4 duplicated blocks

decorators.py:
- set_fastmcp_meta(): Attaches __fastmcp__ metadata through __func__
  for bound methods — replaces 5 identical 2-line blocks

TaskConfig:
- normalize(): Converts bool|TaskConfig|None to TaskConfig — replaces
  4 identical 6-line if/elif/else blocks

No behavior changes beyond the bug fix: existing lambda rejection,
validation, and error handling remain per-module policy.

Closes #3266

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-12 22:46:13 -05:00
..
json_schema_type Add fastmcp-slim for client-only installs (#4122) 2026-05-11 17:13:21 -04:00
openapi fix: OpenAPI request director sends multipart and form-urlencoded as JSON (#3932) 2026-04-14 16:28:55 -04:00
__init__.py restore 1.x code 2025-04-09 11:54:42 -04:00
test_async_utils.py Fix async partial callables rejected by iscoroutinefunction (#3438) 2026-03-07 12:10:09 -05:00
test_auth.py feat: option to add upstream claims to the FastMCP proxy JWT (#2997) 2026-01-28 15:57:24 -05:00
test_callable_utils.py Support functools.partial and centralize callable utilities 2026-05-12 22:46:13 -05:00
test_cli.py Fix path resolution in install commands (#1951) 2025-09-29 20:04:12 -04:00
test_components.py Update ty ignore comments for 0.0.25 compatibility (#3614) 2026-03-24 20:26:26 -04:00
test_docstring_parsing.py Extract parameter descriptions from docstrings (#3872) 2026-04-12 13:43:48 -04:00
test_inspect.py Split large test files to comply with loq line limit (#3328) 2026-02-28 11:21:11 -05:00
test_inspect_icons.py Split large test files to comply with loq line limit (#3328) 2026-02-28 11:21:11 -05:00
test_json_schema.py fix: handle circular JSON Pointer $ref in dereference_refs (#3896) 2026-04-20 13:00:18 -04:00
test_logging.py Add enable_rich_logging setting to disable rich formatting (#2893) 2026-01-16 20:29:29 -05:00
test_skills.py fix: prevent path traversal in skill download (#3493) 2026-03-15 11:22:13 -04:00
test_tests.py fix(openapi): keep blank values in parse_qs (refs #4056) (#4076) 2026-05-04 12:44:06 -04:00
test_token_cache.py Extract TokenCache utility, add caching to GitHubTokenVerifier (#3547) 2026-03-18 15:26:09 -04:00
test_typeadapter.py Fix method-bound tools (#1360) 2025-08-04 09:41:05 -04:00
test_types.py Preserve kw-only defaults when rebuilding functions for resolved annotations (#3429) 2026-03-07 12:10:01 -05:00
test_version_check.py Add CLI update notifications (#2840) 2026-01-10 18:27:03 -05:00