Skip to content

Commit

Permalink
Use unittest test runner for doctests in test_statistics (pythonGH-10…
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiy-storchaka authored Sep 7, 2023
1 parent 74fc96b commit b9831e5
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions Lib/test/test_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down Expand Up @@ -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


Expand Down

0 comments on commit b9831e5

Please sign in to comment.