@@ -28,7 +28,7 @@ def test_negative_max_weight(self):
2828 # profit = [10, 20, 30, 40, 50, 60]
2929 # weight = [2, 4, 6, 8, 10, 12]
3030 # 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." )
3232
3333 def test_negative_profit_value (self ):
3434 """
@@ -38,7 +38,7 @@ def test_negative_profit_value(self):
3838 # profit = [10, -20, 30, 40, 50, 60]
3939 # weight = [2, 4, 6, 8, 10, 12]
4040 # max_weight = 15
41- pytest .raises (ValueError , match = "Weight can not be negative." )
41+ pytest .raises (ValueError , match = r "Weight can not be negative." )
4242
4343 def test_negative_weight_value (self ):
4444 """
@@ -48,7 +48,7 @@ def test_negative_weight_value(self):
4848 # profit = [10, 20, 30, 40, 50, 60]
4949 # weight = [2, -4, 6, -8, 10, 12]
5050 # max_weight = 15
51- pytest .raises (ValueError , match = "Profit can not be negative." )
51+ pytest .raises (ValueError , match = r "Profit can not be negative." )
5252
5353 def test_null_max_weight (self ):
5454 """
@@ -58,7 +58,7 @@ def test_null_max_weight(self):
5858 # profit = [10, 20, 30, 40, 50, 60]
5959 # weight = [2, 4, 6, 8, 10, 12]
6060 # 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." )
6262
6363 def test_unequal_list_length (self ):
6464 """
@@ -68,7 +68,7 @@ def test_unequal_list_length(self):
6868 # profit = [10, 20, 30, 40, 50]
6969 # weight = [2, 4, 6, 8, 10, 12]
7070 # 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." )
7272
7373
7474if __name__ == "__main__" :
0 commit comments