summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_userstring.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_userstring.py')
-rw-r--r--[-rwxr-xr-x]Lib/test/test_userstring.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/Lib/test/test_userstring.py b/Lib/test/test_userstring.py
index 7a8b932..34c629c 100755..100644
--- a/Lib/test/test_userstring.py
+++ b/Lib/test/test_userstring.py
@@ -1,8 +1,8 @@
-#!/usr/bin/env python3
# UserString is a wrapper around the native builtin string type.
# 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 +10,7 @@ from collections import UserString
class UserStringTest(
string_tests.CommonTest,
string_tests.MixinStrUnicodeUserStringTest,
+ unittest.TestCase
):
type2test = UserString
@@ -17,11 +18,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 +43,5 @@ class UserStringTest(
getattr(object, methodname)(*args)
-def test_main():
- support.run_unittest(UserStringTest)
-
if __name__ == "__main__":
- test_main()
+ unittest.main()