summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-04-02 00:55:04 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-04-02 00:55:04 (GMT)
commitcb0f2ad0c2f45ae065ce87c27080355a98965042 (patch)
treee45f3e59af9d227aa26dba9063a7f20ef556d4d8 /Lib/test
parent4d0c1170ef1eb0d0acbbcc6da0fa5a7c6cba4a10 (diff)
downloadcpython-cb0f2ad0c2f45ae065ce87c27080355a98965042.zip
cpython-cb0f2ad0c2f45ae065ce87c27080355a98965042.tar.gz
cpython-cb0f2ad0c2f45ae065ce87c27080355a98965042.tar.bz2
A DocTestSuite cannot run multiple times: it clears its globals dictionary after the first run.
Rebuild the DocTestSuite on each iteration.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_collections.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
index 5a6387a..15f0bf7 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -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)