Add pyright strict mode on the whole project (#1254)

This commit is contained in:
Marcelo Trylesinski 2025-08-11 19:56:37 +02:00 • committed by GitHub
commit c7671e470c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,13 +1,9 @@
from typing import Any
import pytest
from pydantic import FileUrl
from mcp.server.fastmcp.prompts.base import (
AssistantMessage,
Message,
Prompt,
TextContent,
UserMessage,
)
from mcp.server.fastmcp.prompts.base import AssistantMessage, Message, Prompt, TextContent, UserMessage
from mcp.types import EmbeddedResource, TextResourceContents
@ -65,7 +61,7 @@ class TestRenderPrompt:
@pytest.mark.anyio
async def test_fn_returns_multiple_messages(self):
expected = [
expected: list[Message] = [
UserMessage("Hello, world!"),
AssistantMessage("How can I help you today?"),
UserMessage("I'm looking for a restaurant in the center of town."),
@ -160,7 +156,7 @@ class TestRenderPrompt:
async def test_fn_returns_dict_with_resource(self):
"""Test returning a dict with resource content."""
async def fn() -> dict:
async def fn() -> dict[str, Any]:
return {
"role": "user",
"content": {