Skip to content

Commit 3261a05

Browse files
authored
Add test for Lock(..., thread_local=False) (#1326)
Covers the class redis.utils.dummy.
1 parent ae86503 commit 3261a05

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/test_lock.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ def test_lock(self, r):
2626

2727
def test_lock_token(self, r):
2828
lock = self.get_lock(r, 'foo')
29+
self._test_lock_token(r, lock)
30+
31+
def test_lock_token_thread_local_false(self, r):
32+
lock = self.get_lock(r, 'foo', thread_local=False)
33+
self._test_lock_token(r, lock)
34+
35+
def _test_lock_token(self, r, lock):
2936
assert lock.acquire(blocking=False, token='test')
3037
assert r.get('foo') == b'test'
3138
assert lock.local.token == b'test'

0 commit comments

Comments
 (0)