diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2020-04-11 13:20:16 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-11 13:20:16 -0700 |
commit | 3261a05d670f14f5218b83c5d24b67d211efec94 (patch) | |
tree | 691aee035384c9b327f381b6494b01c2e5942998 | |
parent | ae86503e4c9348e43dd927b4a552d72349faf097 (diff) | |
download | redis-py-3261a05d670f14f5218b83c5d24b67d211efec94.tar.gz |
Add test for Lock(..., thread_local=False) (#1326)
Covers the class redis.utils.dummy.
-rw-r--r-- | tests/test_lock.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_lock.py b/tests/test_lock.py index efa9184..e8bd874 100644 --- a/tests/test_lock.py +++ b/tests/test_lock.py @@ -26,6 +26,13 @@ class TestLock(object): def test_lock_token(self, r): lock = self.get_lock(r, 'foo') + self._test_lock_token(r, lock) + + def test_lock_token_thread_local_false(self, r): + lock = self.get_lock(r, 'foo', thread_local=False) + self._test_lock_token(r, lock) + + def _test_lock_token(self, r, lock): assert lock.acquire(blocking=False, token='test') assert r.get('foo') == b'test' assert lock.local.token == b'test' |