tests/test-lock.py
changeset 32319 68c43a416585
parent 32088 0d892d820a51
child 34726 daf12f69699f
--- 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):