Пример #1
0
    def testinheritcheck(self):
        d = tempfile.mkdtemp(dir=os.getcwd())
        state = teststate(self, d)
        def check():
            raise error.LockInheritanceContractViolation('check failed')
        lock = state.makelock(inheritchecker=check)
        state.assertacquirecalled(True)

        with self.assertRaises(error.LockInheritanceContractViolation):
            with lock.inherit():
                pass

        lock.release()
Пример #2
0
 def tryinherit():
     with lock.inherit():
         pass
Пример #3
0
 def tryinherit():
     with lock.inherit():
         pass