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

Method test_default_value

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

Source from the content-addressed store, hash-verified

963 self.assertTimeout(dt, 0.5)
964
965 def test_default_value(self):
966 # The default initial value is 1.
967 sem = self.semtype()
968 sem.acquire()
969 def f():
970 sem.acquire()
971 sem.release()
972
973 with Bunch(f, 1) as bunch:
974 # Thread blocked on sem.acquire()
975 wait_threads_blocked(1)
976 self.assertFalse(bunch.finished)
977
978 # Thread unblocked
979 sem.release()
980
981 def test_with(self):
982 sem = self.semtype(2)

Callers

nothing calls this directly

Calls 5

wait_threads_blockedFunction · 0.85
assertFalseMethod · 0.80
BunchClass · 0.70
acquireMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected