[Zope3-checkins] SVN: zope.testing/trunk/src/zope/testing/doctest.py Changed the way doctest test cases are torn down. Rather than

Jim Fulton jim at zope.com
Sun Oct 9 15:31:57 EDT 2005


Log message for revision 39023:
  Changed the way doctest test cases are torn down.  Rather than
  clearing the test globs, restore them to their original state.
  This is necessary to allow doctest test cases to be run repeatedtly.
  
  We'll need to push this back into the python version -- with tests.
  (We should consider including the python doctest tests here.
  

Changed:
  U   zope.testing/trunk/src/zope/testing/doctest.py

-=-
Modified: zope.testing/trunk/src/zope/testing/doctest.py
===================================================================
--- zope.testing/trunk/src/zope/testing/doctest.py	2005-10-09 18:38:39 UTC (rev 39022)
+++ zope.testing/trunk/src/zope/testing/doctest.py	2005-10-09 19:31:57 UTC (rev 39023)
@@ -2144,6 +2144,7 @@
         self._dt_optionflags = optionflags
         self._dt_checker = checker
         self._dt_test = test
+        self._dt_globs = test.globs.copy()
         self._dt_setUp = setUp
         self._dt_tearDown = tearDown
 
@@ -2164,7 +2165,9 @@
         if self._dt_tearDown is not None:
             self._dt_tearDown(test)
 
+        # restore the original globs
         test.globs.clear()
+        test.globs.update(self._dt_globs)
 
     failureException = DocTestFailureException
 



More information about the Zope3-Checkins mailing list