asyncgenerator fix
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import AsyncIterator
|
||||
from collections.abc import AsyncGenerator
|
||||
from contextlib import asynccontextmanager
|
||||
|
||||
import pytest
|
||||
@@ -14,7 +14,7 @@ from personal_mcp.web.app import create_app
|
||||
|
||||
|
||||
@pytest_asyncio.fixture
|
||||
async def client() -> AsyncIterator[AsyncClient]:
|
||||
async def client() -> AsyncGenerator[AsyncClient]:
|
||||
"""Provides an AsyncClient bound to a fresh application instance."""
|
||||
app = create_app()
|
||||
async with AsyncClient(
|
||||
@@ -30,7 +30,7 @@ def mcp_session_factory():
|
||||
"""Provides an in-process context manager factory for MCP SDK sessions."""
|
||||
|
||||
@asynccontextmanager
|
||||
async def create_session(*, initialize: bool = True) -> AsyncIterator[ClientSession]:
|
||||
async def create_session(*, initialize: bool = True) -> AsyncGenerator[ClientSession]:
|
||||
app = create_app()
|
||||
mcp_url = f"http://testserver{app.state.settings.mounts.mcp}"
|
||||
async with (
|
||||
|
||||
Reference in New Issue
Block a user