Skip to content

Commit b9831e5

Browse files
Use unittest test runner for doctests in test_statistics (GH-108921)
1 parent 74fc96b commit b9831e5

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

Lib/test/test_statistics.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -698,14 +698,6 @@ def test_check_all(self):
698698
'missing name "%s" in __all__' % name)
699699

700700

701-
class DocTests(unittest.TestCase):
702-
@unittest.skipIf(sys.flags.optimize >= 2,
703-
"Docstrings are omitted with -OO and above")
704-
def test_doc_tests(self):
705-
failed, tried = doctest.testmod(statistics, optionflags=doctest.ELLIPSIS)
706-
self.assertGreater(tried, 0)
707-
self.assertEqual(failed, 0)
708-
709701
class StatisticsErrorTest(unittest.TestCase):
710702
def test_has_exception(self):
711703
errmsg = (
@@ -3145,6 +3137,7 @@ def tearDown(self):
31453137
def load_tests(loader, tests, ignore):
31463138
"""Used for doctest/unittest integration."""
31473139
tests.addTests(doctest.DocTestSuite())
3140+
tests.addTests(doctest.DocTestSuite(statistics))
31483141
return tests
31493142

31503143

0 commit comments

Comments
 (0)