[Checkins] SVN: zc.async/trunk/src/zc/async/ftesting. bugfix: setUp/tearDown only worked once.

Gary Poster gary at zope.com
Fri Jul 4 20:26:41 EDT 2008


Log message for revision 88021:
  bugfix: setUp/tearDown only worked once.

Changed:
  U   zc.async/trunk/src/zc/async/ftesting.py
  U   zc.async/trunk/src/zc/async/ftesting.txt

-=-
Modified: zc.async/trunk/src/zc/async/ftesting.py
===================================================================
--- zc.async/trunk/src/zc/async/ftesting.py	2008-07-04 22:25:40 UTC (rev 88020)
+++ zc.async/trunk/src/zc/async/ftesting.py	2008-07-05 00:26:39 UTC (rev 88021)
@@ -35,3 +35,4 @@
     dispatcher = zc.async.dispatcher.get()
     dispatcher.reactor.callFromThread(dispatcher.reactor.stop)
     dispatcher.thread.join(3)
+    zc.async.dispatcher.clear()

Modified: zc.async/trunk/src/zc/async/ftesting.txt
===================================================================
--- zc.async/trunk/src/zc/async/ftesting.txt	2008-07-04 22:25:40 UTC (rev 88020)
+++ zc.async/trunk/src/zc/async/ftesting.txt	2008-07-05 00:26:39 UTC (rev 88021)
@@ -135,8 +135,22 @@
     >>> dispatcher.activated
     False
 
-If you used a FileStorage, as we did here, you'll need to clean up as well.
+You can then start another async-enabled functional test up again later in the
+same layer, of course.
 
+    >>> zc.async.ftesting.setUp()
+    >>> dispatcher = zc.async.dispatcher.get()
+    >>> bool(dispatcher.activated)
+    True
+
+    >>> zc.async.ftesting.tearDown()
+    >>> dispatcher.activated
+    False
+
+In your test or your test's tearDown, if you used a FileStorage, as we did
+here, you'll need to clean up as well.  We normally do this in our tests'
+tearDowns, but we do it here, now, to make the point.
+
     >>> db.close()
     >>> storage.close()
     >>> storage.cleanup()



More information about the Checkins mailing list