equal
deleted
inserted
replaced
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 |