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

Method test_lock

Lib/test/test_asyncio/test_locks.py:37–46  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

35 self.assertTrue(RGX_REPR.match(repr(lock)))
36
37 async def test_lock(self):
38 lock = asyncio.Lock()
39
40 with self.assertRaisesRegex(
41 TypeError,
42 "'Lock' object can't be awaited"
43 ):
44 await lock
45
46 self.assertFalse(lock.locked())
47
48 async def test_lock_doesnt_accept_loop_parameter(self):
49 primitives_cls = [

Callers

nothing calls this directly

Calls 4

lockedMethod · 0.95
LockMethod · 0.80
assertRaisesRegexMethod · 0.80
assertFalseMethod · 0.80

Tested by

no test coverage detected