tests: add missing init files (#1831)

This commit is contained in:
Marcelo Trylesinski 2026-01-06 19:52:09 +01:00 • committed by GitHub
commit 6149b63a44
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 21 deletions

View file

View file

View file

@ -3,7 +3,7 @@ Tests for OAuth error handling in the auth handlers.
"""
import unittest.mock
from typing import TYPE_CHECKING, Any
from typing import Any
from urllib.parse import parse_qs, urlparse
import httpx
@ -14,12 +14,7 @@ from starlette.applications import Starlette
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

View file

@ -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
@ -14,9 +14,7 @@ from mcp.server.fastmcp.utilities.types import Audio, Image
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,
@ -27,9 +25,6 @@ from mcp.types import (
TextResourceContents,
)
if TYPE_CHECKING:
from mcp.server.fastmcp import Context
class TestServer:
@pytest.mark.anyio