[Zope3-checkins] SVN: zope.testing/trunk/s Fixed tear-down order bug.

Jim Fulton jim at zope.com
Thu Mar 29 14:51:28 EDT 2007


Log message for revision 73919:
  Fixed tear-down order bug.
  

Changed:
  U   zope.testing/trunk/setup.py
  U   zope.testing/trunk/src/zope/testing/setupstack.py
  U   zope.testing/trunk/src/zope/testing/setupstack.txt

-=-
Modified: zope.testing/trunk/setup.py
===================================================================
--- zope.testing/trunk/setup.py	2007-03-29 18:40:46 UTC (rev 73918)
+++ zope.testing/trunk/setup.py	2007-03-29 18:51:28 UTC (rev 73919)
@@ -45,6 +45,7 @@
     'testrunner-leaks.txt',
     'testrunner-knit.txt',
     'formparser.txt',
+    'setupstack.txt',
     )])
     
 setup(

Modified: zope.testing/trunk/src/zope/testing/setupstack.py
===================================================================
--- zope.testing/trunk/src/zope/testing/setupstack.py	2007-03-29 18:40:46 UTC (rev 73918)
+++ zope.testing/trunk/src/zope/testing/setupstack.py	2007-03-29 18:51:28 UTC (rev 73919)
@@ -29,7 +29,7 @@
 def tearDown(test):
     stack = test.globs.get(key)
     while stack:
-        f, p, k = stack.pop(0)
+        f, p, k = stack.pop()
         f(*p, **k)
 
 def setUpDirectory(test):

Modified: zope.testing/trunk/src/zope/testing/setupstack.txt
===================================================================
--- zope.testing/trunk/src/zope/testing/setupstack.txt	2007-03-29 18:40:46 UTC (rev 73918)
+++ zope.testing/trunk/src/zope/testing/setupstack.txt	2007-03-29 18:51:28 UTC (rev 73919)
@@ -29,11 +29,13 @@
 Now, when we call the tearDown function:
 
     >>> zope.testing.setupstack.tearDown(test)
+    td 2
     td 1
-    td 2
 
-The registered tearDown functions are run.
+The registered tearDown functions are run. Note that they are run in
+the reverse order that they were registered.
 
+
 Extra positional arguments can be passed to register:
 
     >>> zope.testing.setupstack.register(



More information about the Zope3-Checkins mailing list