diff -r 7c3ef55dedbe -r 68c43a416585 tests/test-lock.py --- a/tests/test-lock.py Sat May 13 11:42:42 2017 -0700 +++ b/tests/test-lock.py Sat May 13 11:52:44 2017 -0700 @@ -260,12 +260,10 @@ lock = state.makelock(inheritchecker=check) state.assertacquirecalled(True) - def tryinherit(): + with self.assertRaises(error.LockInheritanceContractViolation): with lock.inherit(): pass - self.assertRaises(error.LockInheritanceContractViolation, tryinherit) - lock.release() def testfrequentlockunlock(self):