mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-23 22:14:18 +02:00
Raise errors when deprecated routes are used
This commit is contained in:
parent
6b308a6651
commit
29eb9af467
6 changed files with 19 additions and 3 deletions
|
|
@ -86,7 +86,7 @@ fallback-version = "0.0.0"
|
|||
asyncio_mode = "auto"
|
||||
asyncio_default_fixture_loop_scope = "session"
|
||||
asyncio_default_test_loop_scope = "session"
|
||||
filterwarnings = []
|
||||
filterwarnings = ["error::DeprecationWarning"]
|
||||
timeout = 3
|
||||
env = [
|
||||
"FASTMCP_TEST_MODE=1",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
import pytest
|
||||
|
||||
# reset deprecation warnings for this module
|
||||
pytestmark = pytest.mark.filterwarnings("default::DeprecationWarning")
|
||||
|
|
@ -1,5 +1,3 @@
|
|||
"""Tests for deprecated functionality."""
|
||||
|
||||
import warnings
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
|
|
@ -8,6 +6,9 @@ from starlette.applications import Starlette
|
|||
|
||||
from fastmcp import Client, FastMCP
|
||||
|
||||
# reset deprecation warnings for this module
|
||||
pytestmark = pytest.mark.filterwarnings("default::DeprecationWarning")
|
||||
|
||||
|
||||
def test_sse_app_deprecation_warning():
|
||||
"""Test that sse_app raises a deprecation warning."""
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@ import pytest
|
|||
|
||||
from fastmcp import FastMCP
|
||||
|
||||
# reset deprecation warnings for this module
|
||||
pytestmark = pytest.mark.filterwarnings("default::DeprecationWarning")
|
||||
|
||||
|
||||
def test_mount_tool_separator_deprecation_warning():
|
||||
"""Test that using tool_separator in mount() raises a deprecation warning."""
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
"""Tests for legacy resource prefix behavior."""
|
||||
|
||||
import pytest
|
||||
|
||||
from fastmcp import Client, FastMCP
|
||||
from fastmcp.server.server import (
|
||||
add_resource_prefix,
|
||||
|
|
@ -8,6 +10,9 @@ from fastmcp.server.server import (
|
|||
)
|
||||
from fastmcp.utilities.tests import temporary_settings
|
||||
|
||||
# reset deprecation warnings for this module
|
||||
pytestmark = pytest.mark.filterwarnings("default::DeprecationWarning")
|
||||
|
||||
|
||||
class TestLegacyResourcePrefixes:
|
||||
"""Test the legacy resource prefix behavior."""
|
||||
|
|
|
|||
|
|
@ -12,6 +12,9 @@ from fastmcp.server.openapi import (
|
|||
RouteType,
|
||||
)
|
||||
|
||||
# reset deprecation warnings for this module
|
||||
pytestmark = pytest.mark.filterwarnings("default::DeprecationWarning")
|
||||
|
||||
|
||||
def test_route_type_ignore_deprecation_warning():
|
||||
"""Test that using RouteType.IGNORE emits a deprecation warning."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue