diff options
Diffstat (limited to 'tests/test_asyncio/test_lock.py')
-rw-r--r-- | tests/test_asyncio/test_lock.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_asyncio/test_lock.py b/tests/test_asyncio/test_lock.py index 56387fa..15c3ec5 100644 --- a/tests/test_asyncio/test_lock.py +++ b/tests/test_asyncio/test_lock.py @@ -97,6 +97,14 @@ class TestLock: assert 8 < (await r.pttl("foo")) <= 9500 await lock.release() + async def test_blocking(self, r): + blocking = False + lock = self.get_lock(r, "foo", blocking=blocking) + assert not lock.blocking + + lock_2 = self.get_lock(r, "foo") + assert lock_2.blocking + async def test_blocking_timeout(self, r, event_loop): lock1 = self.get_lock(r, "foo") assert await lock1.acquire(blocking=False) |