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

Method test__is_owned

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

Source from the content-addressed store, hash-verified

468 bunch.do_finish()
469
470 def test__is_owned(self):
471 lock = self.locktype()
472 self.assertFalse(lock._is_owned())
473 lock.acquire()
474 self.assertTrue(lock._is_owned())
475 lock.acquire()
476 self.assertTrue(lock._is_owned())
477 result = []
478 def f():
479 result.append(lock._is_owned())
480 with Bunch(f, 1):
481 pass
482 self.assertFalse(result[0])
483 lock.release()
484 self.assertTrue(lock._is_owned())
485 lock.release()
486 self.assertFalse(lock._is_owned())
487
488
489class EventTests(BaseTestCase):

Callers

nothing calls this directly

Calls 6

assertFalseMethod · 0.80
assertTrueMethod · 0.80
BunchClass · 0.70
_is_ownedMethod · 0.45
acquireMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected