Skip to content

Commit cc85150

Browse files
authored
Merge pull request #4658 from dalinaum/test_userstring
Update test/test_userstring.py from CPython 3.11.2
2 parents 01512e2 + 9865463 commit cc85150

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

Lib/test/test_userstring.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)