@@ -189,16 +189,16 @@ def test_iou_wrong_input():
189
189
IoU (None )
190
190
191
191
cm = ConfusionMatrix (num_classes = 10 )
192
- with pytest .raises (ValueError , match = "ignore_index should be non-negative integer" ):
192
+ with pytest .raises (ValueError , match = r "ignore_index should be integer and in the range of \[0, 10\), but given -1 " ):
193
193
IoU (cm , ignore_index = - 1 )
194
194
195
- with pytest .raises (ValueError , match = "ignore_index should be non-negative integer" ):
195
+ with pytest .raises (ValueError , match = r "ignore_index should be integer and in the range of \[0, 10\), but given a " ):
196
196
IoU (cm , ignore_index = "a" )
197
197
198
- with pytest .raises (ValueError , match = "ignore_index should be non-negative integer" ):
198
+ with pytest .raises (ValueError , match = r "ignore_index should be integer and in the range of \[0, 10\), but given 10 " ):
199
199
IoU (cm , ignore_index = 10 )
200
200
201
- with pytest .raises (ValueError , match = "ignore_index should be non-negative integer" ):
201
+ with pytest .raises (ValueError , match = r "ignore_index should be integer and in the range of \[0, 10\), but given 11 " ):
202
202
IoU (cm , ignore_index = 11 )
203
203
204
204
@@ -403,16 +403,16 @@ def test_dice_coefficient_wrong_input():
403
403
DiceCoefficient (None )
404
404
405
405
cm = ConfusionMatrix (num_classes = 10 )
406
- with pytest .raises (ValueError , match = "ignore_index should be non-negative integer" ):
406
+ with pytest .raises (ValueError , match = r "ignore_index should be integer and in the range of \[0, 10\), but given -1 " ):
407
407
DiceCoefficient (cm , ignore_index = - 1 )
408
408
409
- with pytest .raises (ValueError , match = "ignore_index should be non-negative integer" ):
409
+ with pytest .raises (ValueError , match = r "ignore_index should be integer and in the range of \[0, 10\), but given a " ):
410
410
DiceCoefficient (cm , ignore_index = "a" )
411
411
412
- with pytest .raises (ValueError , match = "ignore_index should be non-negative integer" ):
412
+ with pytest .raises (ValueError , match = r "ignore_index should be integer and in the range of \[0, 10\), but given 10 " ):
413
413
DiceCoefficient (cm , ignore_index = 10 )
414
414
415
- with pytest .raises (ValueError , match = "ignore_index should be non-negative integer" ):
415
+ with pytest .raises (ValueError , match = r "ignore_index should be integer and in the range of \[0, 10\), but given 11 " ):
416
416
DiceCoefficient (cm , ignore_index = 11 )
417
417
418
418
0 commit comments