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

Method test_different_thread

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

Source from the content-addressed store, hash-verified

456 self.assertEqual(0, lock._recursion_count())
457
458 def test_different_thread(self):
459 # Cannot release from a different thread
460 lock = self.locktype()
461 def f():
462 lock.acquire()
463
464 with Bunch(f, 1, True) as bunch:
465 try:
466 self.assertRaises(RuntimeError, lock.release)
467 finally:
468 bunch.do_finish()
469
470 def test__is_owned(self):
471 lock = self.locktype()

Callers

nothing calls this directly

Calls 3

BunchClass · 0.70
assertRaisesMethod · 0.45
do_finishMethod · 0.45

Tested by

no test coverage detected