Skip to content

Commit

Permalink
Add test for Lock(..., thread_local=False) (#1326)
Browse files Browse the repository at this point in the history
Covers the class redis.utils.dummy.
  • Loading branch information
jdufresne authored Apr 11, 2020
1 parent ae86503 commit 3261a05
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ def test_lock(self, r):

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'
Expand Down

0 comments on commit 3261a05

Please sign in to comment.