mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
bpo-45229: Use doctest.DocTestSuite instead of run_doctest (GH-28468)
Alo use load_tests() for adding tests.
This commit is contained in:
parent
5e2c32e08e
commit
a856364cc9
17 changed files with 117 additions and 183 deletions
|
|
@ -2351,19 +2351,10 @@ class TestCounter(unittest.TestCase):
|
|||
self.assertFalse(Counter(a=2, b=1, c=0) > Counter('aab'))
|
||||
|
||||
|
||||
################################################################################
|
||||
### Run tests
|
||||
################################################################################
|
||||
|
||||
def test_main(verbose=None):
|
||||
NamedTupleDocs = doctest.DocTestSuite(module=collections)
|
||||
test_classes = [TestNamedTuple, NamedTupleDocs, TestOneTrickPonyABCs,
|
||||
TestCollectionABCs, TestCounter, TestChainMap,
|
||||
TestUserObjects,
|
||||
]
|
||||
support.run_unittest(*test_classes)
|
||||
support.run_doctest(collections, verbose)
|
||||
def load_tests(loader, tests, pattern):
|
||||
tests.addTest(doctest.DocTestSuite(collections))
|
||||
return tests
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_main(verbose=True)
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue