@@ -28,7 +28,7 @@ def test_negative_max_weight(self):
28
28
# profit = [10, 20, 30, 40, 50, 60]
29
29
# weight = [2, 4, 6, 8, 10, 12]
30
30
# max_weight = -15
31
- pytest .raises (ValueError , match = "max_weight must greater than zero." )
31
+ pytest .raises (ValueError , match = r "max_weight must greater than zero." )
32
32
33
33
def test_negative_profit_value (self ):
34
34
"""
@@ -38,7 +38,7 @@ def test_negative_profit_value(self):
38
38
# profit = [10, -20, 30, 40, 50, 60]
39
39
# weight = [2, 4, 6, 8, 10, 12]
40
40
# max_weight = 15
41
- pytest .raises (ValueError , match = "Weight can not be negative." )
41
+ pytest .raises (ValueError , match = r "Weight can not be negative." )
42
42
43
43
def test_negative_weight_value (self ):
44
44
"""
@@ -48,7 +48,7 @@ def test_negative_weight_value(self):
48
48
# profit = [10, 20, 30, 40, 50, 60]
49
49
# weight = [2, -4, 6, -8, 10, 12]
50
50
# max_weight = 15
51
- pytest .raises (ValueError , match = "Profit can not be negative." )
51
+ pytest .raises (ValueError , match = r "Profit can not be negative." )
52
52
53
53
def test_null_max_weight (self ):
54
54
"""
@@ -58,7 +58,7 @@ def test_null_max_weight(self):
58
58
# profit = [10, 20, 30, 40, 50, 60]
59
59
# weight = [2, 4, 6, 8, 10, 12]
60
60
# max_weight = null
61
- pytest .raises (ValueError , match = "max_weight must greater than zero." )
61
+ pytest .raises (ValueError , match = r "max_weight must greater than zero." )
62
62
63
63
def test_unequal_list_length (self ):
64
64
"""
@@ -68,7 +68,7 @@ def test_unequal_list_length(self):
68
68
# profit = [10, 20, 30, 40, 50]
69
69
# weight = [2, 4, 6, 8, 10, 12]
70
70
# max_weight = 100
71
- pytest .raises (IndexError , match = "The length of profit and weight must be same." )
71
+ pytest .raises (IndexError , match = r "The length of profit and weight must be same." )
72
72
73
73
74
74
if __name__ == "__main__" :
0 commit comments