diff options
Diffstat (limited to 'Lib/test/test_descrtut.py')
-rw-r--r-- | Lib/test/test_descrtut.py | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/Lib/test/test_descrtut.py b/Lib/test/test_descrtut.py index 8e25f58d7aa..2af683e707c 100644 --- a/Lib/test/test_descrtut.py +++ b/Lib/test/test_descrtut.py @@ -10,6 +10,9 @@ from test.support import sortdict import pprint +import doctest +import unittest + class defaultdict(dict): def __init__(self, default=None): @@ -469,19 +472,10 @@ __test__ = {"tut1": test_1, "tut7": test_7, "tut8": test_8} -# Magic test name that regrtest.py invokes *after* importing this module. -# This worms around a bootstrap problem. -# Note that doctest and regrtest both look in sys.argv for a "-v" argument, -# so this works as expected in both ways of running regrtest. -def test_main(verbose=None): - # Obscure: import this module as test.test_descrtut instead of as - # plain test_descrtut because the name of this module works its way - # into the doctest examples, and unless the full test.test_descrtut - # business is used the name can change depending on how the test is - # invoked. - from test import support, test_descrtut - support.run_doctest(test_descrtut, verbose) - -# This part isn't needed for regrtest, but for running the test directly. +def load_tests(loader, tests, pattern): + tests.addTest(doctest.DocTestSuite()) + return tests + + if __name__ == "__main__": - test_main(1) + unittest.main() |