Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def setUp(self):
super().setUp()
self.timer = ContextTimer()
def test_acquire_same_lock_twice_blocking_without_timeout(self):
assert not self.redis.exists(self.redlock.key)
with ContextTimer() as timer:
assert self.redlock.acquire()
assert self.redis.exists(self.redlock.key)
assert self.redlock.acquire()
assert self.redis.exists(self.redlock.key)
assert timer.elapsed() >= self.redlock.auto_release_time