Skip to content

Commit ef0628f

Browse files
test: fix type annotations in dependency injection tests
Fixed missing type arguments in dict type annotations to satisfy pyright type checking requirements. Changed: - dict -> dict[str, str] in test functions
1 parent d93f8af commit ef0628f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/server/mcpserver/utilities/test_dependencies.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ def get_value() -> str:
101101

102102
@pytest.mark.anyio
103103
async def test_resolve_nested_dependency(self):
104-
def get_config() -> dict:
104+
def get_config() -> dict[str, str]:
105105
return {"db_url": "test"}
106106

107-
def get_db(config: dict = Depends(get_config)) -> str:
107+
def get_db(config: dict[str, str] = Depends(get_config)) -> str:
108108
return config["db_url"]
109109

110110
resolver = DependencyResolver()
@@ -140,10 +140,10 @@ async def get_async_value() -> str:
140140

141141
@pytest.mark.anyio
142142
async def test_resolve_nested_async_dependency(self):
143-
async def get_config() -> dict:
143+
async def get_config() -> dict[str, str]:
144144
return {"db_url": "test_async"}
145145

146-
async def get_db(config: dict = Depends(get_config)) -> str:
146+
async def get_db(config: dict[str, str] = Depends(get_config)) -> str:
147147
return config["db_url"]
148148

149149
resolver = DependencyResolver()

0 commit comments

Comments
 (0)