From dab125e0690bfe2ce43dd2e7f6a60109c7fc89bf Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Date: Sat, 1 Nov 2025 11:53:51 -0700 Subject: [PATCH 1/2] Remove test warnings (#2331) --- pyproject.toml | 5 +++++ tests/client/test_sse.py | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 991203674a..fec290757e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,6 +103,11 @@ fallback-version = "0.0.0" [tool.pytest.ini_options] asyncio_mode = "auto" # filterwarnings = ["error::DeprecationWarning"] +filterwarnings = [ + # Suppress OAuth in-memory token storage warnings in tests + # Tests intentionally use ephemeral storage; this warning is for end users + "ignore:Using in-memory token storage:UserWarning", +] timeout = 5 env = [ "FASTMCP_TEST_MODE=1", diff --git a/tests/client/test_sse.py b/tests/client/test_sse.py index 914b505a2d..7110d5cfd3 100644 --- a/tests/client/test_sse.py +++ b/tests/client/test_sse.py @@ -94,10 +94,13 @@ async def nested_sse_server(): from starlette.applications import Starlette from starlette.routing import Mount + from fastmcp.server.http import create_sse_app from fastmcp.utilities.http import find_available_port server = create_test_server() - sse_app = server.sse_app(path="/mcp/sse/", message_path="/mcp/messages") + sse_app = create_sse_app( + server=server, message_path="/mcp/messages", sse_path="/mcp/sse/" + ) # Nest the app under multiple mounts to test URL resolution inner = Starlette(routes=[Mount("/nest-inner", app=sse_app)]) From 087ff022b880b0d5d3615226cd0a4b96b2c82768 Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Date: Sat, 1 Nov 2025 15:06:08 -0400 Subject: [PATCH 2/2] Create new branch and fix issue --- src/fastmcp/__init__.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/fastmcp/__init__.py b/src/fastmcp/__init__.py index d47bf88c8f..99cce018d3 100644 --- a/src/fastmcp/__init__.py +++ b/src/fastmcp/__init__.py @@ -27,26 +27,6 @@ warnings.simplefilter("default", DeprecationWarning) -def __getattr__(name: str): - """ - Used to deprecate the module-level Image class; can be removed once it is no longer imported to root. - """ - if name == "Image": - # Deprecated in 2.8.1 - if settings.deprecation_warnings: - warnings.warn( - "The top-level `fastmcp.Image` import is deprecated " - "and will be removed in a future version. " - "Please use `fastmcp.utilities.types.Image` instead.", - DeprecationWarning, - stacklevel=2, - ) - from fastmcp.utilities.types import Image - - return Image - raise AttributeError(f"module '{__name__}' has no attribute '{name}'") - - __all__ = [ "Client", "Context",