fastmcp/tests
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
..
apps Add default prefill to FormInput.collect_input (#3937) 2026-04-14 13:23:36 -04:00
cli fix: cli option --no-banner is NOT passed to cli but server-spec in-correctly when cli --reload option is specified. (#4083) 2026-05-09 14:57:42 -04:00
client Add fastmcp-slim for client-only installs (#4122) 2026-05-11 17:13:21 -04:00
conformance Run MCP conformance tests in CI (#3628) 2026-03-26 22:19:13 -04:00
contrib fix: resolve Pyright "Module is not callable" on @tool, @resource, @prompt decorators (#3540) 2026-03-17 18:11:42 -04:00
deprecated Deprecate ctx.elicit() without response_type (#3916) 2026-04-13 21:23:31 -04:00
docs Fix broken code examples in docs (#3869) 2026-04-12 12:53:04 -04:00
experimental Update ty ignore comments for 0.0.25 compatibility (#3614) 2026-03-24 20:26:26 -04:00
fs fix: FileSystemProvider reload race condition (#3938) 2026-04-16 18:45:11 -04:00
integration_tests Add Keycloak OAuth Provider for Enterprise Authentication and local dev (#1937) 2026-04-13 12:23:10 -04:00
prompts Add log_level parameter to FastMCP errors (#4036) 2026-05-04 12:38:16 -04:00
resources Fix #4056: keep blank query values, add token bucket regression test (#4069) 2026-05-04 12:44:38 -04:00
server fix(http): terminate active streamable-HTTP transports before lifespan shutdown (#4118) 2026-05-10 10:58:13 -04:00
telemetry Use standard traceparent/tracestate keys per OTel MCP semconv (#3221) 2026-02-18 15:51:24 -05:00
tools Support functools.partial and centralize callable utilities 2026-05-12 22:46:13 -05:00
utilities Support functools.partial and centralize callable utilities 2026-05-12 22:46:13 -05:00
__init__.py Update type handling for resources 2024-11-29 19:42:46 -05:00
conftest.py Expose minimum_check_interval, reduce task pickup latency (#3500) 2026-03-14 16:08:28 -04:00
test_apps.py fix: Don't completely hide plain mcp.tool app-only tools (#4112) 2026-05-09 14:55:20 -04:00
test_apps_prefab.py Replace ___ with hash-based backend tool routing and per-tool prefab resources (#3824) 2026-04-12 12:52:07 -04:00
test_fastmcp_app.py Replace ___ with hash-based backend tool routing and per-tool prefab resources (#3824) 2026-04-12 12:52:07 -04:00
test_json_schema_generation.py fix: resolve Pyright "Module is not callable" on @tool, @resource, @prompt decorators (#3540) 2026-03-17 18:11:42 -04:00
test_mcp_config.py Update ty ignore comments for 0.0.25 compatibility (#3614) 2026-03-24 20:26:26 -04:00