@@ -288,18 +288,18 @@ def test_multiple_nested_fields_same_parent(self):
288288
289289 def test_validation_error_on_invalid_helper_field (self ):
290290 """Test that MappingHelper validation catches mismatched fields."""
291- with pytest .raises (ValueError , match = "MappingHelper created for" ):
292291
293- class InvalidModel (ModelCreate [CreateCalculatedChannelRequest ]):
294- name : str
292+ class InvalidModel (ModelCreate [CreateCalculatedChannelRequest ]):
293+ name : str
295294
296- _to_proto_helpers : ClassVar [dict [str , MappingHelper ]] = {
297- "nonexistent_field" : MappingHelper (proto_attr_path = "some.path" ),
298- }
295+ _to_proto_helpers : ClassVar [dict [str , MappingHelper ]] = {
296+ "nonexistent_field" : MappingHelper (proto_attr_path = "some.path" ),
297+ }
299298
300- def _get_proto_class (self ):
301- return CreateCalculatedChannelRequest
299+ def _get_proto_class (self ):
300+ return CreateCalculatedChannelRequest
302301
302+ with pytest .raises (ValueError , match = "MappingHelper created for" ):
303303 # This should raise during __init__
304304 InvalidModel (name = "test" )
305305
@@ -495,7 +495,7 @@ def _from_proto(cls, proto, sift_client=None):
495495 model = TestModel (name = "test" )
496496
497497 # Should not be able to modify frozen model
498- with pytest .raises (Exception ): # Pydantic raises ValidationError # noqa: B017
498+ with pytest .raises (Exception ): # noqa: B017, PT011
499499 model .name = "new_name"
500500
501501
0 commit comments