Skip to content

Commit 6149b63

Browse files
authored
tests: add missing init files (#1831)
1 parent 37de501 commit 6149b63

File tree

6 files changed

+5
-21
lines changed

6 files changed

+5
-21
lines changed

tests/issues/test_1027_win_unreachable_cleanup.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,13 @@
1212
import tempfile
1313
import textwrap
1414
from pathlib import Path
15-
from typing import TYPE_CHECKING
1615

1716
import anyio
1817
import pytest
1918

2019
from mcp import ClientSession, StdioServerParameters
2120
from mcp.client.stdio import _create_platform_compatible_process, stdio_client
22-
23-
# TODO(Marcelo): This doesn't seem to be the right path. We should fix this.
24-
if TYPE_CHECKING:
25-
from ..shared.test_win32_utils import escape_path_for_python
26-
else:
27-
from tests.shared.test_win32_utils import escape_path_for_python
21+
from tests.shared.test_win32_utils import escape_path_for_python
2822

2923

3024
@pytest.mark.anyio

tests/server/auth/__init__.py

Whitespace-only changes.

tests/server/auth/middleware/__init__.py

Whitespace-only changes.

tests/server/auth/test_error_handling.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44

55
import unittest.mock
6-
from typing import TYPE_CHECKING, Any
6+
from typing import Any
77
from urllib.parse import parse_qs, urlparse
88

99
import httpx
@@ -14,12 +14,7 @@
1414

1515
from mcp.server.auth.provider import AuthorizeError, RegistrationError, TokenError
1616
from mcp.server.auth.routes import create_auth_routes
17-
18-
# TODO(Marcelo): This TYPE_CHECKING shouldn't be here, but pytest doesn't seem to get the module correctly.
19-
if TYPE_CHECKING:
20-
from ...server.fastmcp.auth.test_auth_integration import MockOAuthProvider
21-
else:
22-
from tests.server.fastmcp.auth.test_auth_integration import MockOAuthProvider
17+
from tests.server.fastmcp.auth.test_auth_integration import MockOAuthProvider
2318

2419

2520
@pytest.fixture

tests/server/fastmcp/test_server.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import base64
22
from pathlib import Path
3-
from typing import TYPE_CHECKING, Any
3+
from typing import Any
44
from unittest.mock import patch
55

66
import pytest
@@ -14,9 +14,7 @@
1414
from mcp.server.session import ServerSession
1515
from mcp.server.transport_security import TransportSecuritySettings
1616
from mcp.shared.exceptions import McpError
17-
from mcp.shared.memory import (
18-
create_connected_server_and_client_session as client_session,
19-
)
17+
from mcp.shared.memory import create_connected_server_and_client_session as client_session
2018
from mcp.types import (
2119
AudioContent,
2220
BlobResourceContents,
@@ -27,9 +25,6 @@
2725
TextResourceContents,
2826
)
2927

30-
if TYPE_CHECKING:
31-
from mcp.server.fastmcp import Context
32-
3328

3429
class TestServer:
3530
@pytest.mark.anyio

tests/shared/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)