Commit c100ac29 authored by Tres Seaver's avatar Tres Seaver

Fix the one NastyConflict test runnable w/o ZODB.

When ZODB is not around, we use a custom exception class for BTree-
internal conflicts (as opposed to those raised by the storage).
parent c98e525d
...@@ -802,7 +802,10 @@ class NastyConfictFunctionalTests(Base, unittest.TestCase): ...@@ -802,7 +802,10 @@ class NastyConfictFunctionalTests(Base, unittest.TestCase):
# to decref a NULL pointer if conflict resolution was fed 3 empty # to decref a NULL pointer if conflict resolution was fed 3 empty
# buckets. http://collector.zope.org/Zope/553 # buckets. http://collector.zope.org/Zope/553
def testThreeEmptyBucketsNoSegfault(self): def testThreeEmptyBucketsNoSegfault(self):
from ZODB.POSException import ConflictError # Note that the conflict is raised by our C extension, rather than
# indirectly via the storage, and hence is a more specialized type.
# This test therefore does not require ZODB.
from BTrees.Interfaces import BTreesConflictError
t = self._makeOne() t = self._makeOne()
t[1] = 1 t[1] = 1
bucket = t._firstbucket bucket = t._firstbucket
...@@ -815,11 +818,11 @@ class NastyConfictFunctionalTests(Base, unittest.TestCase): ...@@ -815,11 +818,11 @@ class NastyConfictFunctionalTests(Base, unittest.TestCase):
state3 is not state1) state3 is not state1)
self.assert_(state2 == state1 and self.assert_(state2 == state1 and
state3 == state1) state3 == state1)
self.assertRaises(ConflictError, bucket._p_resolveConflict, self.assertRaises(BTreesConflictError, bucket._p_resolveConflict,
state1, state2, state3) state1, state2, state3)
# When an empty BTree resolves conflicts, it computes the # When an empty BTree resolves conflicts, it computes the
# bucket state as None, so... # bucket state as None, so...
self.assertRaises(ConflictError, bucket._p_resolveConflict, self.assertRaises(BTreesConflictError, bucket._p_resolveConflict,
None, None, None) None, None, None)
@_skip_wo_ZODB @_skip_wo_ZODB
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment