@@ -575,8 +575,8 @@ def test_get_and_verify_batch_sizes_inconsistent_batch_sizes_two_components():
575575 update_data : BatchDataset = {"foo" : np .empty (shape = (3 , 3 )), "bar" : np .empty (shape = (2 , 3 ))}
576576 with pytest .raises (
577577 ValueError ,
578- match = "Inconsistent number of batches in batch data. "
579- "Component 'bar' contains 2 batches, while 'foo' contained 3 batches." ,
578+ match = r "Inconsistent number of batches in batch data\ . "
579+ r "Component \ 'bar\ ' contains 2 batches, while \ 'foo\ ' contained 3 batches\ ." ,
580580 ):
581581 get_and_verify_batch_sizes (update_data )
582582
@@ -589,16 +589,16 @@ def test_convert_get_and_verify_batch_sizes_inconsistent_batch_sizes_more_than_t
589589 }
590590 with pytest .raises (
591591 ValueError ,
592- match = "Inconsistent number of batches in batch data. "
593- "Component 'baz' contains 2 batches, while bar/foo contained 3 batches." ,
592+ match = r "Inconsistent number of batches in batch data\ . "
593+ r "Component \ 'baz\ ' contains 2 batches, while bar\ /foo contained 3 batches\ ." ,
594594 ):
595595 get_and_verify_batch_sizes (update_data )
596596
597597
598598@patch ("power_grid_model._core.utils.get_and_verify_batch_sizes" )
599599def test_convert_batch_dataset_to_batch_list_missing_key_sparse (_mock : MagicMock ):
600600 update_data : BatchDataset = {"foo" : {"a" : np .empty (3 ), "data" : np .empty (3 )}} # type: ignore
601- with pytest .raises (KeyError , match = "Invalid data for 'foo' component. Missing 'indptr' in sparse batch data. " ):
601+ with pytest .raises (KeyError , match = r "Invalid data for \ 'foo\ ' component\ . Missing \ 'indptr\ ' in sparse batch data" ):
602602 convert_batch_dataset_to_batch_list (update_data )
603603
604604
@@ -607,7 +607,7 @@ def test_convert_batch_dataset_to_batch_list_invalid_type_sparse(_mock: MagicMoc
607607 update_data : BatchDataset = {"foo" : "wrong type" } # type: ignore
608608 with pytest .raises (
609609 TypeError ,
610- match = "Invalid data for 'foo' component. Expecting a 1D/2D Numpy structured array or a dictionary of such. " ,
610+ match = r "Invalid data for \ 'foo\ ' component\ . Expecting a 1D\ /2D Numpy structured array or a dictionary of such" ,
611611 ):
612612 convert_batch_dataset_to_batch_list (update_data )
613613
@@ -789,7 +789,7 @@ def test_get_dataset_type(dataset_type):
789789
790790
791791def test_get_dataset_type__empty_data ():
792- with pytest .raises (ValueError , match = "At least one component should have row based data. " ):
792+ with pytest .raises (ValueError , match = "At least one component should have row based data" ):
793793 get_dataset_type (data = {})
794794
795795
0 commit comments