mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
Use unittest test runner for doctests in test_statistics (GH-108921)
This commit is contained in:
parent
74fc96bc60
commit
b9831e5c98
1 changed files with 1 additions and 8 deletions
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue