Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions tests/issues/test_1027_win_unreachable_cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,13 @@
import tempfile
import textwrap
from pathlib import Path
from typing import TYPE_CHECKING

import anyio
import pytest

from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import _create_platform_compatible_process, stdio_client

# TODO(Marcelo): This doesn't seem to be the right path. We should fix this.
if TYPE_CHECKING:
from ..shared.test_win32_utils import escape_path_for_python
else:
from tests.shared.test_win32_utils import escape_path_for_python
from tests.shared.test_win32_utils import escape_path_for_python


@pytest.mark.anyio
Expand Down
Empty file added tests/server/auth/__init__.py
Empty file.
Empty file.
9 changes: 2 additions & 7 deletions tests/server/auth/test_error_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

import unittest.mock
from typing import TYPE_CHECKING, Any
from typing import Any
from urllib.parse import parse_qs, urlparse

import httpx
Expand All @@ -14,12 +14,7 @@

from mcp.server.auth.provider import AuthorizeError, RegistrationError, TokenError
from mcp.server.auth.routes import create_auth_routes

# TODO(Marcelo): This TYPE_CHECKING shouldn't be here, but pytest doesn't seem to get the module correctly.
if TYPE_CHECKING:
from ...server.fastmcp.auth.test_auth_integration import MockOAuthProvider
else:
from tests.server.fastmcp.auth.test_auth_integration import MockOAuthProvider
from tests.server.fastmcp.auth.test_auth_integration import MockOAuthProvider


@pytest.fixture
Expand Down
9 changes: 2 additions & 7 deletions tests/server/fastmcp/test_server.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import base64
from pathlib import Path
from typing import TYPE_CHECKING, Any
from typing import Any
from unittest.mock import patch

import pytest
Expand All @@ -14,9 +14,7 @@
from mcp.server.session import ServerSession
from mcp.server.transport_security import TransportSecuritySettings
from mcp.shared.exceptions import McpError
from mcp.shared.memory import (
create_connected_server_and_client_session as client_session,
)
from mcp.shared.memory import create_connected_server_and_client_session as client_session
from mcp.types import (
AudioContent,
BlobResourceContents,
Expand All @@ -27,9 +25,6 @@
TextResourceContents,
)

if TYPE_CHECKING:
from mcp.server.fastmcp import Context


class TestServer:
@pytest.mark.anyio
Expand Down
Empty file added tests/shared/__init__.py
Empty file.