Ejemplo n.º 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()
Ejemplo n.º 2
0
 def tryinherit():
     with lock.inherit():
         pass
Ejemplo n.º 3
0
 def tryinherit():
     with lock.inherit():
         pass