Remove test warnings (#2331)

This commit is contained in:
Jeremiah Lowin 2025-11-01 11:53:51 -07:00 committed by GitHub
commit dab125e069
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View file

@ -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",

View file

@ -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)])