summaryrefslogtreecommitdiff
path: root/Lib/test/test_doctest.py
diff options
context:
space:
mode:
authorEthan Furman <ethan@stoneleaf.us>2021-10-20 20:55:46 -0700
committerGitHub <noreply@github.com>2021-10-20 20:55:46 -0700
commitc52338fc42353e8d0c6214e4c22427807439dfd5 (patch)
tree6da4bf5da5eb739aa48eab1850218d5726c45b10 /Lib/test/test_doctest.py
parent8f05ffb0534c2343fc45ad0e1d91ae1dc2d92b64 (diff)
parent2a9ab75af32b1ee9f210ae2a0718990687d0f79d (diff)
downloadcpython-git-enum-private-310.tar.gz
Merge branch '3.10' into enum-private-310enum-private-310
Diffstat (limited to 'Lib/test/test_doctest.py')
-rw-r--r--Lib/test/test_doctest.py20
1 files changed, 6 insertions, 14 deletions
diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py
index 828a0ff567..7f8ccd3896 100644
--- a/Lib/test/test_doctest.py
+++ b/Lib/test/test_doctest.py
@@ -3110,20 +3110,11 @@ def test_no_trailing_whitespace_stripping():
patches that contain trailing whitespace. More info on Issue 24746.
"""
-######################################################################
-## Main
-######################################################################
-
-def test_main():
- # Check the doctest cases in doctest itself:
- ret = support.run_doctest(doctest, verbosity=True)
- # Check the doctest cases defined here:
- from test import test_doctest
- support.run_doctest(test_doctest, verbosity=True)
-
- # Run unittests
- support.run_unittest(__name__)
+def load_tests(loader, tests, pattern):
+ tests.addTest(doctest.DocTestSuite(doctest))
+ tests.addTest(doctest.DocTestSuite())
+ return tests
def test_coverage(coverdir):
@@ -3136,8 +3127,9 @@ def test_coverage(coverdir):
r.write_results(show_missing=True, summary=True,
coverdir=coverdir)
+
if __name__ == '__main__':
if '-c' in sys.argv:
test_coverage('/tmp/doctest.cover')
else:
- test_main()
+ unittest.main()