Skip to content

Commit

Permalink
Merge pull request #9 from luizalabs/jh-fix_lock_context
Browse files Browse the repository at this point in the history
fix lock active context
  • Loading branch information
renanivo committed Sep 27, 2016
2 parents f7ca3ed + 2849307 commit 1c9c9ea
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion django_toolkit/concurrent/locks.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def __enter__(self):
if not self.active and self.raise_exception:
raise LockActiveError('For key {key}'.format(key=self._key))

self.active = True
return self

def __exit__(self, *args, **kwargs):
Expand Down
3 changes: 1 addition & 2 deletions tests/concurrent/test_locks.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,4 @@ def test_should_not_raise_exception_when_raise_exception_is_false(self):
assert lock.active is True

with CacheLock(key='test', raise_exception=False) as lock:
assert lock.active is True
pass
assert lock.active is False

0 comments on commit 1c9c9ea

Please sign in to comment.