diff --git a/tests/integration/asyncio/proxy/map_test.py b/tests/integration/asyncio/proxy/map_test.py index ff716e240d..d128c7d7f1 100644 --- a/tests/integration/asyncio/proxy/map_test.py +++ b/tests/integration/asyncio/proxy/map_test.py @@ -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)