MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_acquire

Method test_acquire

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

Source from the content-addressed store, hash-verified

601 """
602
603 def test_acquire(self):
604 cond = self.condtype()
605 # Be default we have an RLock: the condition can be acquired multiple
606 # times.
607 cond.acquire()
608 cond.acquire()
609 cond.release()
610 cond.release()
611 lock = threading.Lock()
612 cond = self.condtype(lock)
613 cond.acquire()
614 self.assertFalse(lock.acquire(False))
615 cond.release()
616 self.assertTrue(lock.acquire(False))
617 self.assertFalse(cond.acquire(False))
618 lock.release()
619 with cond:
620 self.assertFalse(lock.acquire(False))
621
622 def test_unacquired_wait(self):
623 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