Commit cb0f2ad0 authored by Amaury Forgeot d'Arc's avatar Amaury Forgeot d'Arc

A DocTestSuite cannot run multiple times: it clears its globals dictionary after the first run.

Rebuild the DocTestSuite on each iteration.
parent 4d0c1170
......@@ -305,13 +305,12 @@ class TestCollectionABCs(unittest.TestCase):
self.failIf(issubclass(basestring, MutableSequence))
import doctest, collections
NamedTupleDocs = doctest.DocTestSuite(module=collections)
def test_main(verbose=None):
import collections as CollectionsModule
NamedTupleDocs = doctest.DocTestSuite(module=collections)
test_classes = [TestNamedTuple, NamedTupleDocs, TestOneTrickPonyABCs, TestCollectionABCs]
test_support.run_unittest(*test_classes)
test_support.run_doctest(CollectionsModule, verbose)
test_support.run_doctest(collections, verbose)
if __name__ == "__main__":
test_main(verbose=True)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment