mirror of
https://github.com/python/cpython.git
synced 2025-10-10 17:02:46 +00:00
Add a basic test for UserString.MutableString.
This commit is contained in:
parent
8e1afab111
commit
3040b19976
1 changed files with 9 additions and 2 deletions
|
@ -5,7 +5,7 @@
|
||||||
import unittest
|
import unittest
|
||||||
from test import test_support, string_tests
|
from test import test_support, string_tests
|
||||||
|
|
||||||
from UserString import UserString
|
from UserString import UserString, MutableString
|
||||||
|
|
||||||
class UserStringTest(
|
class UserStringTest(
|
||||||
string_tests.CommonTest,
|
string_tests.CommonTest,
|
||||||
|
@ -43,8 +43,15 @@ class UserStringTest(
|
||||||
# we don't fix the arguments, because UserString can't cope with it
|
# we don't fix the arguments, because UserString can't cope with it
|
||||||
getattr(object, methodname)(*args)
|
getattr(object, methodname)(*args)
|
||||||
|
|
||||||
|
class MutableStringTest(UserStringTest):
|
||||||
|
type2test = MutableString
|
||||||
|
|
||||||
|
# MutableStrings can be hashed => deactivate test
|
||||||
|
def test_hash(self):
|
||||||
|
pass
|
||||||
|
|
||||||
def test_main():
|
def test_main():
|
||||||
test_support.run_unittest(UserStringTest)
|
test_support.run_unittest(UserStringTest, MutableStringTest)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
test_main()
|
test_main()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue