@@ -414,7 +414,12 @@ class CustomItemLoader(ItemLoader):
414414 name_in = MapCompose (float )
415415
416416 il = CustomItemLoader ()
417- with pytest .raises (ValueError , match = "could not convert string to float" ):
417+ with pytest .raises (
418+ ValueError ,
419+ match = "Error with input processor MapCompose: .* "
420+ "error='ValueError: Error in MapCompose .* "
421+ "error='ValueError: could not convert" ,
422+ ):
418423 il .add_value ("name" , ["marta" , "other" ])
419424
420425 def test_error_output_processor (self ):
@@ -423,14 +428,21 @@ class CustomItemLoader(ItemLoader):
423428
424429 il = CustomItemLoader ()
425430 il .add_value ("name" , "marta" )
426- with pytest .raises (ValueError , match = "could not convert string to float" ):
431+ with pytest .raises (
432+ ValueError ,
433+ match = "Error with output processor: .* "
434+ "error='ValueError: Error in Compose .* "
435+ "error='ValueError: could not convert" ,
436+ ):
427437 il .load_item ()
428438
429439 def test_error_processor_as_argument (self ):
430440 il = CustomItemLoader ()
431441 with pytest .raises (
432442 ValueError ,
433- match = r"float\(\) argument must be a string or a real number, not 'list'" ,
443+ match = r"Error with processor Compose .* "
444+ r"error='ValueError: Error in Compose .* "
445+ r"error='TypeError: float\(\) argument" ,
434446 ):
435447 il .add_value ("name" , ["marta" , "other" ], Compose (float ))
436448
0 commit comments