[Zodb-checkins] CVS: Zope3/src/zope/testing - functional.py:1.18.2.1

Marius Gedminas marius at pov.lt
Mon Mar 8 14:28:46 EST 2004


Update of /cvs-repository/Zope3/src/zope/testing
In directory cvs.zope.org:/tmp/cvs-serv26336/src/zope/testing

Modified Files:
      Tag: mgedmin-events2-branch
	functional.py 
Log Message:
I've decided that the interaction on security proxies is just a cache, and
therefore security policies should cope with it being None and should use
getInteraction() in that case.  (This policy can become problematic if a
security proxy created in one interaction survives it.  However, if this
policy is changed, then storing interactions in security proxies makes
no sense.)

Also added a missing call to endInteraction in the functional test mechanism.
(I'm really starting to think that endInteraction should never throw) and
some debugging code in newInteraction that helps finding the place where
a "leaked" interaction was created.



=== Zope3/src/zope/testing/functional.py 1.18 => 1.18.2.1 ===
--- Zope3/src/zope/testing/functional.py:1.18	Mon Feb 23 05:20:23 2004
+++ Zope3/src/zope/testing/functional.py	Mon Mar  8 14:28:44 2004
@@ -32,6 +32,7 @@
 from zope.publisher.http import HTTPRequest
 from zope.publisher.publish import publish
 from zope.exceptions import Forbidden, Unauthorized
+from zope.security.management import endInteraction
 
 from zope.app import Application
 from zope.app.publication.zopepublication import ZopePublication
@@ -254,6 +255,9 @@
                 # __del__ methods happen if request.close() is not called here
                 if request:
                     request.close()
+                # Make sure the interaction is ended
+                try: endInteraction()
+                except: pass
         if errors:
             self.fail("%s contains broken links:\n" % path
                       + "\n".join(["  %s:\t%s" % (a, e) for a, e in errors]))




More information about the Zodb-checkins mailing list