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_cmd.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_cmd.py')
| -rw-r--r-- | Lib/test/test_cmd.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_cmd.py b/Lib/test/test_cmd.py index 96e0c30..5e8b17c 100644 --- a/Lib/test/test_cmd.py +++ b/Lib/test/test_cmd.py @@ -6,6 +6,7 @@ Original by Michael Schneider import cmd import sys +import doctest import unittest import io from test import support @@ -219,10 +220,9 @@ class TestAlternateInput(unittest.TestCase): "(Cmd) *** Unknown syntax: EOF\n")) -def test_main(verbose=None): - from test import test_cmd - support.run_doctest(test_cmd, verbose) - support.run_unittest(TestAlternateInput) +def load_tests(loader, tests, pattern): + tests.addTest(doctest.DocTestSuite()) + return tests def test_coverage(coverdir): trace = support.import_module('trace') @@ -239,4 +239,4 @@ if __name__ == "__main__": elif "-i" in sys.argv: samplecmdclass().cmdloop() else: - test_main() + unittest.main() |
