Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions tests/integration/asyncio/proxy/map_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,17 @@ async def hold_lock():
self.assertFalse(acquired)
release.set()

async def test_lock_context_reentrancy(self):
# nested lock context must be supported
key = "lock-context-key"

async def task():
async with self.map.lock_context(key):
async with self.map.lock_context(key):
pass

await asyncio.create_task(task())

async def test_put_all(self):
m = {"key-%d" % x: "value-%d" % x for x in range(0, 1000)}
await self.map.put_all(m)
Expand Down
Loading