MCPcopy Index your code
hub / github.com/python/cpython / test_acquire

Method test_acquire

Lib/test/lock_tests.py:606–623  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

604 """
605
606 def test_acquire(self):
607 cond = self.condtype()
608 # Be default we have an RLock: the condition can be acquired multiple
609 # times.
610 cond.acquire()
611 cond.acquire()
612 cond.release()
613 cond.release()
614 lock = threading.Lock()
615 cond = self.condtype(lock)
616 cond.acquire()
617 self.assertFalse(lock.acquire(False))
618 cond.release()
619 self.assertTrue(lock.acquire(False))
620 self.assertFalse(cond.acquire(False))
621 lock.release()
622 with cond:
623 self.assertFalse(lock.acquire(False))
624
625 def test_unacquired_wait(self):
626 cond = self.condtype()

Callers

nothing calls this directly

Calls 7

acquireMethod · 0.95
releaseMethod · 0.95
LockMethod · 0.80
assertFalseMethod · 0.80
assertTrueMethod · 0.80
acquireMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected