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

Method test_lock

Lib/test/_test_multiprocessing.py:1598–1605  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1596 p.terminate()
1597
1598 def test_lock(self):
1599 lock = self.Lock()
1600 self.assertEqual(lock.acquire(), True)
1601 self.assertTrue(lock.locked())
1602 self.assertEqual(lock.acquire(False), False)
1603 self.assertEqual(lock.release(), None)
1604 self.assertFalse(lock.locked())
1605 self.assertRaises((ValueError, threading.ThreadError), lock.release)
1606
1607 @classmethod
1608 def _test_lock_locked_2processes(cls, lock, event, res):

Callers

nothing calls this directly

Calls 8

acquireMethod · 0.95
lockedMethod · 0.95
releaseMethod · 0.95
LockMethod · 0.80
assertTrueMethod · 0.80
assertFalseMethod · 0.80
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected