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:
Serhiy Storchaka 2021-09-13 10:49:53 +03:00 committed by GitHub
parent c78d5ca380
commit 851811f577
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 80 additions and 93 deletions

View file

@ -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 @@ def test_fractions(self):
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()