@@ -14,12 +14,6 @@ class UserStringTest(
14
14
15
15
type2test = UserString
16
16
17
- def test_removeprefix (self ):
18
- super ().test_removeprefix ()
19
-
20
- def test_removesuffix (self ):
21
- super ().test_removesuffix ()
22
-
23
17
# Overwrite the three testing methods, because UserString
24
18
# can't cope with arguments propagated to UserString
25
19
# (and we don't test with subclasses)
@@ -33,12 +27,14 @@ def checkequal(self, result, object, methodname, *args, **kwargs):
33
27
realresult
34
28
)
35
29
36
- def checkraises (self , exc , obj , methodname , * args ):
30
+ def checkraises (self , exc , obj , methodname , * args , expected_msg = None ):
37
31
obj = self .fixtype (obj )
38
32
# we don't fix the arguments, because UserString can't cope with it
39
33
with self .assertRaises (exc ) as cm :
40
34
getattr (obj , methodname )(* args )
41
35
self .assertNotEqual (str (cm .exception ), '' )
36
+ if expected_msg is not None :
37
+ self .assertEqual (str (cm .exception ), expected_msg )
42
38
43
39
def checkcall (self , object , methodname , * args ):
44
40
object = self .fixtype (object )
0 commit comments