[Zodb-checkins] SVN: ZODB/branches/3.8-2.5/src/ Adjusted tests to avoid spurious errors due to Python versiond

Jim Fulton jim at zope.com
Mon Jun 18 06:53:02 EDT 2007


Log message for revision 76754:
  Adjusted tests to avoid spurious errors due to Python versiond
  differences.
  

Changed:
  U   ZODB/branches/3.8-2.5/src/ZEO/tests/testZEO.py
  U   ZODB/branches/3.8-2.5/src/ZODB/tests/testFileStorage.py
  U   ZODB/branches/3.8-2.5/src/persistent/tests/testPersistent.py

-=-
Modified: ZODB/branches/3.8-2.5/src/ZEO/tests/testZEO.py
===================================================================
--- ZODB/branches/3.8-2.5/src/ZEO/tests/testZEO.py	2007-06-18 08:50:15 UTC (rev 76753)
+++ ZODB/branches/3.8-2.5/src/ZEO/tests/testZEO.py	2007-06-18 10:53:02 UTC (rev 76754)
@@ -731,8 +731,8 @@
     
     >>> trans, oids = s1.getInvalidations(last)
     >>> from ZODB.utils import u64
-    >>> sorted([u64(oid) for (oid, v) in oids])
-    [10L, 11L, 12L, 13L, 14L]
+    >>> sorted([int(u64(oid)) for (oid, v) in oids])
+    [10, 11, 12, 13, 14]
     
     >>> server.close_server()
     """
@@ -785,8 +785,8 @@
 
 
     >>> from ZODB.utils import u64
-    >>> sorted([u64(oid) for (oid, version) in oids])
-    [0L, 92L, 93L, 94L, 95L, 96L, 97L, 98L, 99L, 100L]
+    >>> sorted([int(u64(oid)) for (oid, version) in oids])
+    [0, 92, 93, 94, 95, 96, 97, 98, 99, 100]
 
 (Note that the fact that we get oids for 92-100 is actually an
 artifact of the fact that the FileStorage lastInvalidations method
@@ -833,8 +833,8 @@
     >>> ntid == last[-1]
     True
 
-    >>> sorted([u64(oid) for (oid, version) in oids])
-    [0L, 101L, 102L, 103L, 104L]
+    >>> sorted([int(u64(oid)) for (oid, version) in oids])
+    [0, 101, 102, 103, 104]
 
     """
 

Modified: ZODB/branches/3.8-2.5/src/ZODB/tests/testFileStorage.py
===================================================================
--- ZODB/branches/3.8-2.5/src/ZODB/tests/testFileStorage.py	2007-06-18 08:50:15 UTC (rev 76753)
+++ ZODB/branches/3.8-2.5/src/ZODB/tests/testFileStorage.py	2007-06-18 10:53:02 UTC (rev 76754)
@@ -508,11 +508,11 @@
     True
 
     >>> from ZODB.utils import u64
-    >>> [[u64(oid) for (oid, version) in oids]
+    >>> [[int(u64(oid)) for (oid, version) in oids]
     ...  for (i, oids) in invalidations]
     ... # doctest: +NORMALIZE_WHITESPACE
-    [[0L, 91L], [0L, 92L], [0L, 93L], [0L, 94L], [0L, 95L],
-     [0L, 96L], [0L, 97L], [0L, 98L], [0L, 99L], [0L, 100L]]
+    [[0, 91], [0, 92], [0, 93], [0, 94], [0, 95],
+     [0, 96], [0, 97], [0, 98], [0, 99], [0, 100]]
 
 If we ask for more transactions than there are, we'll get as many as
 there are:

Modified: ZODB/branches/3.8-2.5/src/persistent/tests/testPersistent.py
===================================================================
--- ZODB/branches/3.8-2.5/src/persistent/tests/testPersistent.py	2007-06-18 08:50:15 UTC (rev 76753)
+++ ZODB/branches/3.8-2.5/src/persistent/tests/testPersistent.py	2007-06-18 10:53:02 UTC (rev 76754)
@@ -161,10 +161,10 @@
         obj = P()
         def setstate(value):
             obj._p_state = value
-        self.assertRaises(TypeError, setstate, GHOST)
-        self.assertRaises(TypeError, setstate, UPTODATE)
-        self.assertRaises(TypeError, setstate, CHANGED)
-        self.assertRaises(TypeError, setstate, STICKY)
+        self.assertRaises(Exception, setstate, GHOST)
+        self.assertRaises(Exception, setstate, UPTODATE)
+        self.assertRaises(Exception, setstate, CHANGED)
+        self.assertRaises(Exception, setstate, STICKY)
 
     def testInvalidate(self):
         obj = P()



More information about the Zodb-checkins mailing list