Skip to content

Commit 0a55479

Browse files
committed
fix: use model_validate to avoid pyright reportArgumentType error
Replace **dict unpacking with model_validate() in the extra fields test. Pyright cannot narrow dict value types through ** unpacking, causing false reportArgumentType errors for typed params (task, _meta).
1 parent 4029f01 commit 0a55479

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tests/test_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ def test_request_params_allows_extra_fields():
372372
"""
373373
from mcp.types import RequestParams
374374

375-
params = RequestParams(**{"custom_field": "value", "another": 42})
375+
params = RequestParams.model_validate({"custom_field": "value", "another": 42})
376376
assert params.model_extra == {"custom_field": "value", "another": 42}
377377

378378
# Extra fields survive serialization round-trip

0 commit comments

Comments
 (0)