mirror of
https://github.com/python/cpython.git
synced 2025-10-07 15:42:02 +00:00
bpo-5846: Do not use obsolete unittest functions. (GH-28303)
Get rid of use of makeSuite() and findTestCases(). Also make test_math and test_threading_local discoverable.
This commit is contained in:
parent
c78d5ca380
commit
851811f577
49 changed files with 80 additions and 93 deletions
|
@ -4604,7 +4604,7 @@ class PySignalsTest(SignalsTest):
|
|||
test_reentrant_write_text = None
|
||||
|
||||
|
||||
def load_tests(*args):
|
||||
def load_tests(loader, tests, pattern):
|
||||
tests = (CIOTest, PyIOTest, APIMismatchTest,
|
||||
CBufferedReaderTest, PyBufferedReaderTest,
|
||||
CBufferedWriterTest, PyBufferedWriterTest,
|
||||
|
@ -4636,7 +4636,9 @@ def load_tests(*args):
|
|||
for name, obj in py_io_ns.items():
|
||||
setattr(test, name, obj)
|
||||
|
||||
suite = unittest.TestSuite([unittest.makeSuite(test) for test in tests])
|
||||
suite = loader.suiteClass()
|
||||
for test in tests:
|
||||
suite.addTest(loader.loadTestsFromTestCase(test))
|
||||
return suite
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue