diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2021-09-13 10:49:53 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-13 10:49:53 +0300 |
commit | 851811f5772c43f72f445e2ce1ac3ea9da951ae3 (patch) | |
tree | 4178e52377f5bfd4f9e94dc5261eb0a6e05ef6cc /Lib/test/test_threading_local.py | |
parent | c78d5ca3806d02e26f9f3fa92ff567f0805eac4c (diff) | |
download | cpython-git-851811f5772c43f72f445e2ce1ac3ea9da951ae3.tar.gz |
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.
Diffstat (limited to 'Lib/test/test_threading_local.py')
-rw-r--r-- | Lib/test/test_threading_local.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/Lib/test/test_threading_local.py b/Lib/test/test_threading_local.py index 13facb5133..1567c41000 100644 --- a/Lib/test/test_threading_local.py +++ b/Lib/test/test_threading_local.py @@ -201,22 +201,19 @@ class PyThreadingLocalTest(unittest.TestCase, BaseLocalTest): _local = _threading_local.local -def test_main(): - suite = unittest.TestSuite() - suite.addTest(DocTestSuite('_threading_local')) - suite.addTest(unittest.makeSuite(ThreadLocalTest)) - suite.addTest(unittest.makeSuite(PyThreadingLocalTest)) +def load_tests(loader, tests, pattern): + tests.addTest(DocTestSuite('_threading_local')) local_orig = _threading_local.local def setUp(test): _threading_local.local = _thread._local def tearDown(test): _threading_local.local = local_orig - suite.addTest(DocTestSuite('_threading_local', - setUp=setUp, tearDown=tearDown) - ) + tests.addTests(DocTestSuite('_threading_local', + setUp=setUp, tearDown=tearDown) + ) + return tests - support.run_unittest(suite) if __name__ == '__main__': - test_main() + unittest.main() |