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

Method test_locked

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

Source from the content-addressed store, hash-verified

376 self.assertRaises(RuntimeError, lock.release)
377
378 def test_locked(self):
379 lock = self.locktype()
380 self.assertFalse(lock.locked())
381 lock.acquire()
382 self.assertTrue(lock.locked())
383 lock.acquire()
384 self.assertTrue(lock.locked())
385 lock.release()
386 self.assertTrue(lock.locked())
387 lock.release()
388 self.assertFalse(lock.locked())
389
390 def test_locked_with_2threads(self):
391 # see gh-134323: check that a rlock which

Callers

nothing calls this directly

Calls 5

assertFalseMethod · 0.80
assertTrueMethod · 0.80
lockedMethod · 0.45
acquireMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected