From d546c9ff36a8767ebd953f9798a2a14496ccb4da Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Wed, 22 Jul 2026 13:34:43 +0300 Subject: [PATCH] added extra lock context test --- tests/integration/asyncio/proxy/map_test.py | 11 +++++++++++ 1 file changed, 11 insertions(+) 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)