summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_userstring.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_userstring.py')
-rw-r--r--Lib/test/test_userstring.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_userstring.py b/Lib/test/test_userstring.py
index 4d1d8b6..51b4f60 100644
--- a/Lib/test/test_userstring.py
+++ b/Lib/test/test_userstring.py
@@ -27,12 +27,14 @@ class UserStringTest(
realresult
)
- def checkraises(self, exc, obj, methodname, *args):
+ def checkraises(self, exc, obj, methodname, *args, expected_msg=None):
obj = self.fixtype(obj)
# we don't fix the arguments, because UserString can't cope with it
with self.assertRaises(exc) as cm:
getattr(obj, methodname)(*args)
self.assertNotEqual(str(cm.exception), '')
+ if expected_msg is not None:
+ self.assertEqual(str(cm.exception), expected_msg)
def checkcall(self, object, methodname, *args):
object = self.fixtype(object)