tests/test-lock.py
changeset 32279 68c43a416585
parent 32088 0d892d820a51
child 34726 daf12f69699f
equal deleted inserted replaced
32278:7c3ef55dedbe 32279:68c43a416585
   258         def check():
   258         def check():
   259             raise error.LockInheritanceContractViolation('check failed')
   259             raise error.LockInheritanceContractViolation('check failed')
   260         lock = state.makelock(inheritchecker=check)
   260         lock = state.makelock(inheritchecker=check)
   261         state.assertacquirecalled(True)
   261         state.assertacquirecalled(True)
   262 
   262 
   263         def tryinherit():
   263         with self.assertRaises(error.LockInheritanceContractViolation):
   264             with lock.inherit():
   264             with lock.inherit():
   265                 pass
   265                 pass
   266 
       
   267         self.assertRaises(error.LockInheritanceContractViolation, tryinherit)
       
   268 
   266 
   269         lock.release()
   267         lock.release()
   270 
   268 
   271     def testfrequentlockunlock(self):
   269     def testfrequentlockunlock(self):
   272         """This tests whether lock acquisition fails as expected, even if
   270         """This tests whether lock acquisition fails as expected, even if