@@ -54,7 +54,9 @@ def test_no_cfs(self, desired_class, sample_custom_query_1, total_CFs):
5454 @pytest .mark .parametrize (("features_to_vary" , "permitted_range" , "feature_weights" ),
5555 [(['Numerical' ], {'Categorical' : ['b' , 'c' ]}, "inverse_mad" )])
5656 def test_invalid_query_instance (self , sample_custom_query_1 , features_to_vary , permitted_range , feature_weights ):
57- with pytest .raises (ValueError ):
57+ with pytest .raises (
58+ ValueError ,
59+ match = "is outside the permitted range and isn't allowed to vary" ):
5860 self .exp .setup (features_to_vary , permitted_range , sample_custom_query_1 , feature_weights )
5961
6062 # Testing that the features_to_vary argument actually varies only the features that you wish to vary
@@ -112,11 +114,10 @@ def test_permitted_range_categorical(self, desired_class, total_CFs, features_to
112114
113115 # Testing if an error is thrown when the query instance has outcome variable
114116 def test_query_instance_with_target_column (self , sample_custom_query_6 ):
115- with pytest .raises (ValueError ) as ve :
117+ with pytest .raises (
118+ ValueError , match = "present in query instance" ):
116119 self .exp .setup ("all" , None , sample_custom_query_6 , "inverse_mad" )
117120
118- assert "present in query instance" in str (ve )
119-
120121 # Testing if only valid cfs are found after maxiterations
121122 @pytest .mark .parametrize (("desired_class" , "total_CFs" , "initialization" , "maxiterations" ),
122123 [(0 , 7 , "kdtree" , 0 ), (0 , 7 , "random" , 0 )])
0 commit comments