Port all string tests to PyUnit and share as much tests

between str, unicode, UserString and the string module
as possible. This increases code coverage in stringobject.c
from 83% to 86% and should help keep the string classes
in sync in the future. From SF patch #662807
This commit is contained in:
Walter Dörwald 2003-02-21 12:53:50 +00:00
parent 1b56de05d5
commit 0fd583ce4d
6 changed files with 905 additions and 919 deletions

23
Lib/test/test_str.py Normal file
View file

@ -0,0 +1,23 @@
import unittest
from test import test_support, string_tests
class StrTest(
string_tests.CommonTest,
string_tests.MixinStrUnicodeUserStringTest,
string_tests.MixinStrUserStringTest
):
type2test = str
# We don't need to propagate to str
def fixtype(self, obj):
return obj
def test_main():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(StrTest))
test_support.run_suite(suite)
if __name__ == "__main__":
test_main()