mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
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:
parent
1b56de05d5
commit
0fd583ce4d
6 changed files with 905 additions and 919 deletions
23
Lib/test/test_str.py
Normal file
23
Lib/test/test_str.py
Normal 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()
|
Loading…
Add table
Add a link
Reference in a new issue