]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Use unittest test runner for doctests in test_statistics (GH-108921)
authorSerhiy Storchaka <storchaka@gmail.com>
Thu, 7 Sep 2023 20:08:55 +0000 (23:08 +0300)
committerGitHub <noreply@github.com>
Thu, 7 Sep 2023 20:08:55 +0000 (23:08 +0300)
Lib/test/test_statistics.py

index 23a3973305303d58ea8eff1522110ff42fd5d19e..f9b0ac2ad7b11610fc39aec00683c026ab4de69e 100644 (file)
@@ -698,14 +698,6 @@ class GlobalsTest(unittest.TestCase):
                             'missing name "%s" in __all__' % name)
 
 
-class DocTests(unittest.TestCase):
-    @unittest.skipIf(sys.flags.optimize >= 2,
-                     "Docstrings are omitted with -OO and above")
-    def test_doc_tests(self):
-        failed, tried = doctest.testmod(statistics, optionflags=doctest.ELLIPSIS)
-        self.assertGreater(tried, 0)
-        self.assertEqual(failed, 0)
-
 class StatisticsErrorTest(unittest.TestCase):
     def test_has_exception(self):
         errmsg = (
@@ -3145,6 +3137,7 @@ class TestNormalDistC(unittest.TestCase, TestNormalDist):
 def load_tests(loader, tests, ignore):
     """Used for doctest/unittest integration."""
     tests.addTests(doctest.DocTestSuite())
+    tests.addTests(doctest.DocTestSuite(statistics))
     return tests