@@ -14,12 +14,6 @@ class UserStringTest(
1414
1515 type2test = UserString
1616
17- def test_removeprefix (self ):
18- super ().test_removeprefix ()
19-
20- def test_removesuffix (self ):
21- super ().test_removesuffix ()
22-
2317 # Overwrite the three testing methods, because UserString
2418 # can't cope with arguments propagated to UserString
2519 # (and we don't test with subclasses)
@@ -33,12 +27,14 @@ def checkequal(self, result, object, methodname, *args, **kwargs):
3327 realresult
3428 )
3529
36- def checkraises (self , exc , obj , methodname , * args ):
30+ def checkraises (self , exc , obj , methodname , * args , expected_msg = None ):
3731 obj = self .fixtype (obj )
3832 # we don't fix the arguments, because UserString can't cope with it
3933 with self .assertRaises (exc ) as cm :
4034 getattr (obj , methodname )(* args )
4135 self .assertNotEqual (str (cm .exception ), '' )
36+ if expected_msg is not None :
37+ self .assertEqual (str (cm .exception ), expected_msg )
4238
4339 def checkcall (self , object , methodname , * args ):
4440 object = self .fixtype (object )
0 commit comments