@@ -13,7 +13,7 @@ class TestValidationOptions:
13
13
"""Test validation options for MCP client sessions."""
14
14
15
15
@pytest .mark .anyio
16
- async def test_strict_validation_default (self ):
16
+ async def test_strict_validation_default (self ) -> None :
17
17
"""Test that strict validation is enabled by default."""
18
18
# Create a mock client session
19
19
read_stream = MagicMock ()
@@ -45,7 +45,7 @@ async def test_strict_validation_default(self):
45
45
assert "has an output schema but did not return structured content" in str (exc_info .value )
46
46
47
47
@pytest .mark .anyio
48
- async def test_lenient_validation_missing_content (self , caplog ) :
48
+ async def test_lenient_validation_missing_content (self , caplog : pytest . LogCaptureFixture ) -> None :
49
49
"""Test lenient validation when structured content is missing."""
50
50
# Set logging level to capture warnings
51
51
caplog .set_level (logging .WARNING )
@@ -86,7 +86,7 @@ async def test_lenient_validation_missing_content(self, caplog):
86
86
assert result .structuredContent is None
87
87
88
88
@pytest .mark .anyio
89
- async def test_lenient_validation_invalid_content (self , caplog ) :
89
+ async def test_lenient_validation_invalid_content (self , caplog : pytest . LogCaptureFixture ) -> None :
90
90
"""Test lenient validation when structured content is invalid."""
91
91
# Set logging level to capture warnings
92
92
caplog .set_level (logging .WARNING )
@@ -128,7 +128,7 @@ async def test_lenient_validation_invalid_content(self, caplog):
128
128
assert result .structuredContent == {"result" : "not_an_integer" }
129
129
130
130
@pytest .mark .anyio
131
- async def test_strict_validation_with_valid_content (self ):
131
+ async def test_strict_validation_with_valid_content (self ) -> None :
132
132
"""Test that valid structured content passes validation."""
133
133
read_stream = MagicMock ()
134
134
write_stream = MagicMock ()
@@ -157,7 +157,7 @@ async def test_strict_validation_with_valid_content(self):
157
157
assert result .structuredContent == {"result" : 42 }
158
158
159
159
@pytest .mark .anyio
160
- async def test_schema_errors_always_raised (self ):
160
+ async def test_schema_errors_always_raised (self ) -> None :
161
161
"""Test that schema errors are always raised regardless of validation mode."""
162
162
# Create client with lenient validation
163
163
@@ -184,7 +184,7 @@ async def test_schema_errors_always_raised(self):
184
184
assert "Invalid schema for tool test_tool" in str (exc_info .value )
185
185
186
186
@pytest .mark .anyio
187
- async def test_error_results_not_validated (self ):
187
+ async def test_error_results_not_validated (self ) -> None :
188
188
"""Test that error results are not validated."""
189
189
read_stream = MagicMock ()
190
190
write_stream = MagicMock ()
@@ -215,7 +215,7 @@ async def test_error_results_not_validated(self):
215
215
# No exception should be raised
216
216
217
217
@pytest .mark .anyio
218
- async def test_tool_without_output_schema (self ):
218
+ async def test_tool_without_output_schema (self ) -> None :
219
219
"""Test that tools without output schema don't trigger validation."""
220
220
read_stream = MagicMock ()
221
221
write_stream = MagicMock ()
0 commit comments