aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_userstring.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_userstring.py')
-rwxr-xr-xLib/test/test_userstring.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/Lib/test/test_userstring.py b/Lib/test/test_userstring.py
index 7a8b9323f89..71fcac25e13 100755
--- a/Lib/test/test_userstring.py
+++ b/Lib/test/test_userstring.py
@@ -3,6 +3,7 @@
# UserString instances should behave similar to builtin string objects.
import string
+import unittest
from test import support, string_tests
from collections import UserString
@@ -10,6 +11,7 @@ from collections import UserString
class UserStringTest(
string_tests.CommonTest,
string_tests.MixinStrUnicodeUserStringTest,
+ unittest.TestCase
):
type2test = UserString
@@ -17,11 +19,11 @@ class UserStringTest(
# Overwrite the three testing methods, because UserString
# can't cope with arguments propagated to UserString
# (and we don't test with subclasses)
- def checkequal(self, result, object, methodname, *args):
+ def checkequal(self, result, object, methodname, *args, **kwargs):
result = self.fixtype(result)
object = self.fixtype(object)
# we don't fix the arguments, because UserString can't cope with it
- realresult = getattr(object, methodname)(*args)
+ realresult = getattr(object, methodname)(*args, **kwargs)
self.assertEqual(
result,
realresult
@@ -42,8 +44,5 @@ class UserStringTest(
getattr(object, methodname)(*args)
-def test_main():
- support.run_unittest(UserStringTest)
-
if __name__ == "__main__":
- test_main()
+ unittest.main()