From b9831e5c98de280870b6d932033b868ef56fa2fa Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Thu, 7 Sep 2023 23:08:55 +0300 Subject: [PATCH] Use unittest test runner for doctests in test_statistics (GH-108921) --- Lib/test/test_statistics.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Lib/test/test_statistics.py b/Lib/test/test_statistics.py index 23a3973305303d..f9b0ac2ad7b116 100644 --- a/Lib/test/test_statistics.py +++ b/Lib/test/test_statistics.py @@ -698,14 +698,6 @@ def test_check_all(self): '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 @@ def tearDown(self): def load_tests(loader, tests, ignore): """Used for doctest/unittest integration.""" tests.addTests(doctest.DocTestSuite()) + tests.addTests(doctest.DocTestSuite(statistics)) return tests