diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2021-09-20 08:36:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-20 08:36:57 (GMT) |
commit | a856364cc920d8b16750fd1fadc902efb509754c (patch) | |
tree | 1f5f618d8ad0e18fd8718bc8cfaf478cd26280be /Lib/test/test_metaclass.py | |
parent | 5e2c32e08ed77081cabd9d51f0589f81c1572732 (diff) | |
download | cpython-a856364cc920d8b16750fd1fadc902efb509754c.zip cpython-a856364cc920d8b16750fd1fadc902efb509754c.tar.gz cpython-a856364cc920d8b16750fd1fadc902efb509754c.tar.bz2 |
bpo-45229: Use doctest.DocTestSuite instead of run_doctest (GH-28468)
Alo use load_tests() for adding tests.
Diffstat (limited to 'Lib/test/test_metaclass.py')
-rw-r--r-- | Lib/test/test_metaclass.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Lib/test/test_metaclass.py b/Lib/test/test_metaclass.py index 6edd899..36e8ab4 100644 --- a/Lib/test/test_metaclass.py +++ b/Lib/test/test_metaclass.py @@ -1,3 +1,7 @@ +import doctest +import unittest + + doctests = """ Basic class construction. @@ -256,10 +260,10 @@ if hasattr(sys, 'gettrace') and sys.gettrace(): else: __test__ = {'doctests' : doctests} -def test_main(verbose=False): - from test import support - from test import test_metaclass - support.run_doctest(test_metaclass, verbose) +def load_tests(loader, tests, pattern): + tests.addTest(doctest.DocTestSuite()) + return tests + if __name__ == "__main__": - test_main(verbose=True) + unittest.main() |