[Zodb-checkins] SVN: ZODB/branches/3.4/src/ZODB/tests/testPersistentMapping.py checkOldStyleRoot: Can't work in Zope3.

Tim Peters tim.one at comcast.net
Sat Apr 2 18:57:50 EST 2005


Log message for revision 29849:
  checkOldStyleRoot:  Can't work in Zope3.
  
  The Persistence module no longer exists in Zope3's idea of what
  ZODB is, but this test relies on it.  Make it tolerate the
  absence of Persistence.
  

Changed:
  U   ZODB/branches/3.4/src/ZODB/tests/testPersistentMapping.py

-=-
Modified: ZODB/branches/3.4/src/ZODB/tests/testPersistentMapping.py
===================================================================
--- ZODB/branches/3.4/src/ZODB/tests/testPersistentMapping.py	2005-04-02 22:31:11 UTC (rev 29848)
+++ ZODB/branches/3.4/src/ZODB/tests/testPersistentMapping.py	2005-04-02 23:57:50 UTC (rev 29849)
@@ -38,6 +38,13 @@
 class PMTests(unittest.TestCase):
 
     def checkOldStyleRoot(self):
+        # The Persistence module doesn't exist in Zope3's idea of what ZODB
+        # is, but the global `pickle` references it explicitly.  So just
+        # bail if Persistence isn't available.
+        try:
+            import Persistence
+        except ImportError:
+            return
         # insert the pickle in place of the root
         s = MappingStorage()
         t = Transaction()



More information about the Zodb-checkins mailing list