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

Method testWithBoundedSemaphore

Lib/test/test_contextlib.py:497–505  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

495 self.boilerPlate(lock, locked)
496
497 def testWithBoundedSemaphore(self):
498 lock = threading.BoundedSemaphore()
499 def locked():
500 if lock.acquire(False):
501 lock.release()
502 return False
503 else:
504 return True
505 self.boilerPlate(lock, locked)
506
507
508class mycontext(ContextDecorator):

Callers

nothing calls this directly

Calls 2

boilerPlateMethod · 0.95
BoundedSemaphoreMethod · 0.80

Tested by

no test coverage detected