Ejemplo n.º 1
0
        def testD(self):
            lock = Lock()
            lock.acquire()
            lock.release()

            fut = lock.acquire()
            assert fut.done()
Ejemplo n.º 2
0
        def testE(self):
            lock = Lock()
            lock.acquire()

            f1 = lock.acquire()
            assert not f1.done()
            lock.release()

            f2 = lock.acquire()
            assert not f2.done()

            lock.release()
            assert f1.done()

            lock.release()
            assert f2.done()
Ejemplo n.º 3
0
        def testReleasingUnlockedLockRaises(self):
            lock = Lock()

            with pytest.raises(RuntimeError):
                lock.release()