diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2021-09-13 07:49:53 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-13 07:49:53 (GMT) |
commit | 851811f5772c43f72f445e2ce1ac3ea9da951ae3 (patch) | |
tree | 4178e52377f5bfd4f9e94dc5261eb0a6e05ef6cc /Lib/test/test_math.py | |
parent | c78d5ca3806d02e26f9f3fa92ff567f0805eac4c (diff) | |
download | cpython-851811f5772c43f72f445e2ce1ac3ea9da951ae3.zip cpython-851811f5772c43f72f445e2ce1ac3ea9da951ae3.tar.gz cpython-851811f5772c43f72f445e2ce1ac3ea9da951ae3.tar.bz2 |
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_math.py')
-rw-r--r-- | Lib/test/test_math.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/Lib/test/test_math.py b/Lib/test/test_math.py index 42b61c3..6d67d62 100644 --- a/Lib/test/test_math.py +++ b/Lib/test/test_math.py @@ -1,7 +1,7 @@ # Python test set -- math module # XXXX Should not do tests around zero only -from test.support import run_unittest, verbose, requires_IEEE_754 +from test.support import verbose, requires_IEEE_754 from test import support import unittest import itertools @@ -2225,13 +2225,10 @@ class IsCloseTests(unittest.TestCase): self.assertAllNotClose(fraction_examples, rel_tol=1e-9) -def test_main(): +def load_tests(loader, tests, pattern): from doctest import DocFileSuite - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(MathTests)) - suite.addTest(unittest.makeSuite(IsCloseTests)) - suite.addTest(DocFileSuite("ieee754.txt")) - run_unittest(suite) + tests.addTest(DocFileSuite("ieee754.txt")) + return tests if __name__ == '__main__': - test_main() + unittest.main() |