1. Armin Rigo
  2. cpython-withatomic


Amaury Forgeot d'Arc  committed d6e1333

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

Rebuild the DocTestSuite on each iteration.

  • Participants
  • Parent commits 5939900
  • Branches legacy-trunk

Comments (0)

Files changed (1)

File Lib/test/test_collections.py

View file
         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_doctest(CollectionsModule, verbose)
+    test_support.run_doctest(collections, verbose)
 if __name__ == "__main__":