[Zodb-checkins] CVS: Zope3/src/ZODB - broken.py:1.3
Jim Fulton
jim at zope.com
Thu Mar 4 17:42:23 EST 2004
Update of /cvs-repository/Zope3/src/ZODB
In directory cvs.zope.org:/tmp/cvs-serv4003/src/ZODB
Modified Files:
broken.py
Log Message:
Added missing test cleanup code
=== Zope3/src/ZODB/broken.py 1.2 => 1.3 ===
--- Zope3/src/ZODB/broken.py:1.2 Fri Feb 27 16:40:20 2004
+++ Zope3/src/ZODB/broken.py Thu Mar 4 17:41:52 2004
@@ -87,6 +87,9 @@
>>> a2.__Broken_state__
{'x': 1}
+ Cleanup::
+
+ >>> broken_cache.clear()
"""
__Broken_state__ = __Broken_initargs__ = None
@@ -120,7 +123,10 @@
def __setattr__(self, name, value):
raise BrokenModified("Can't change broken objects")
-def find_global(modulename, globalname, Broken=Broken):
+def find_global(modulename, globalname,
+ # These are *not* optimizations. Callers can override these.
+ Broken=Broken, type=type,
+ ):
"""Find a global object, returning a broken class if it can't be found.
This function looks up global variable in modules::
@@ -167,6 +173,9 @@
>>> find_global('ZODB.not.there', 'atall') is broken
True
+ Cleanup::
+
+ >>> broken_cache.clear()
"""
try:
__import__(modulename)
@@ -217,6 +226,10 @@
>>> del sys.modules['ZODB.notthere']
+ Cleanup::
+
+ >>> broken_cache.clear()
+
"""
class_ = find_global(modulename, globalname)
return class_.__new__(class_, *args)
@@ -279,6 +292,10 @@
>>> a.__setstate__({'y': 2})
>>> a.__getstate__()
{'y': 2}
+
+ Cleanup::
+
+ >>> broken_cache.clear()
"""
More information about the Zodb-checkins
mailing list