diff --git a/tests/test_lock.py b/tests/test_lock.py index 028f9a6021..d732ae1f1e 100644 --- a/tests/test_lock.py +++ b/tests/test_lock.py @@ -16,7 +16,7 @@ def get_lock(self, redis, *args, **kwargs): def test_lock(self, sr): lock = self.get_lock(sr, 'foo') assert lock.acquire(blocking=False) - assert sr.get('foo') == lock.token + assert sr.get('foo') == lock.local.token assert sr.ttl('foo') == -1 lock.release() assert sr.get('foo') is None @@ -56,7 +56,7 @@ def test_context_manager(self, sr): # blocking_timeout prevents a deadlock if the lock can't be acquired # for some reason with self.get_lock(sr, 'foo', blocking_timeout=0.2) as lock: - assert sr.get('foo') == lock.token + assert sr.get('foo') == lock.local.token assert sr.get('foo') is None def test_high_sleep_raises_error(self, sr): @@ -77,7 +77,7 @@ def test_releasing_lock_no_longer_owned_raises_error(self, sr): with pytest.raises(LockError): lock.release() # even though we errored, the token is still cleared - assert lock.token is None + assert lock.local.token is None def test_extend_lock(self, sr): lock = self.get_lock(sr, 'foo', timeout=10)