From 30c4a381795ee3feb76c5947769e20236468e89d Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Mon, 19 Jan 2026 12:03:26 +0900 Subject: [PATCH] test: const --- tests/mcp_tests/mcp_server.py | 2 -- tests/mcp_tests/test_proxy_mcp_e2e.py | 19 +++++++------------ 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/tests/mcp_tests/mcp_server.py b/tests/mcp_tests/mcp_server.py index c4daff4ab1..bc6accbb72 100644 --- a/tests/mcp_tests/mcp_server.py +++ b/tests/mcp_tests/mcp_server.py @@ -1,6 +1,4 @@ # math_server.py -from __future__ import annotations - import argparse import os diff --git a/tests/mcp_tests/test_proxy_mcp_e2e.py b/tests/mcp_tests/test_proxy_mcp_e2e.py index b124fabe8b..2b8cde5471 100644 --- a/tests/mcp_tests/test_proxy_mcp_e2e.py +++ b/tests/mcp_tests/test_proxy_mcp_e2e.py @@ -27,10 +27,7 @@ PROJECT_ROOT = Path(__file__).resolve().parents[2] PROXY_START_TIMEOUT = 30 -@pytest.fixture(scope="session") -def proxy_authorization_header() -> str: - """Shared Authorization header value for proxy calls.""" - return "Bearer sk-1234" +PROXY_AUTHORIZATION_HEADER = "Bearer sk-1234" @pytest.fixture(scope="session", autouse=True) @@ -153,14 +150,12 @@ def proxy_server_url( class TestProxyMcpSimpleConnections: @pytest.mark.asyncio - async def test_proxy_mcp_stdio_roundtrip( - self, proxy_server_url: str, proxy_authorization_header: str - ) -> None: + async def test_proxy_mcp_stdio_roundtrip(self, proxy_server_url: str) -> None: async with asyncio.timeout(20): async with streamablehttp_client( url=f"{proxy_server_url}/mcp", headers={ - "Authorization": proxy_authorization_header, + "Authorization": PROXY_AUTHORIZATION_HEADER, "x-mcp-servers": "math_stdio", }, ) as (read, write, _get_session_id): @@ -179,13 +174,13 @@ class TestProxyMcpSimpleConnections: @pytest.mark.asyncio async def test_proxy_mcp_streamable_http_roundtrip( - self, proxy_server_url: str, proxy_authorization_header: str + self, proxy_server_url: str ) -> None: async with asyncio.timeout(20): async with streamablehttp_client( url=f"{proxy_server_url}/mcp", headers={ - "Authorization": proxy_authorization_header, + "Authorization": PROXY_AUTHORIZATION_HEADER, "x-mcp-servers": "math_streamable_http", }, ) as (read, write, _get_session_id): @@ -204,12 +199,12 @@ class TestProxyMcpSimpleConnections: @pytest.mark.asyncio async def test_proxy_mcp_lists_all_servers_without_header( - self, proxy_server_url: str, proxy_authorization_header: str + self, proxy_server_url: str ) -> None: async with asyncio.timeout(20): async with streamablehttp_client( url=f"{proxy_server_url}/mcp", - headers={"Authorization": proxy_authorization_header}, + headers={"Authorization": PROXY_AUTHORIZATION_HEADER}, ) as (read, write, _get_session_id): async with ClientSession(read, write) as session: await session.initialize()