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

Method test_different_thread

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

Source from the content-addressed store, hash-verified

453 self.assertEqual(0, lock._recursion_count())
454
455 def test_different_thread(self):
456 # Cannot release from a different thread
457 lock = self.locktype()
458 def f():
459 lock.acquire()
460
461 with Bunch(f, 1, True) as bunch:
462 try:
463 self.assertRaises(RuntimeError, lock.release)
464 finally:
465 bunch.do_finish()
466
467 def test__is_owned(self):
468 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