Skip to content

Commit

Permalink
Fix up test_pipeline_move test for older redis-py
Browse files Browse the repository at this point in the history
Older versions would skip issuing a transaction if it had no commands,
even if there were watches.
  • Loading branch information
bmerry committed Aug 18, 2020
1 parent 1a4f6e9 commit b3776cd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/test_fakeredis.py
Original file line number Diff line number Diff line change
Expand Up @@ -3292,8 +3292,11 @@ def test_pipeline_move(r):
r.set('foo', 'bar')
p = r.pipeline()
p.watch('foo')
p.move('foo', 1)
r.move('foo', 1)
# Ensure the transaction isn't empty, which had different behaviour in
# older versions of redis-py.
p.multi()
p.set('bar', 'baz')
with pytest.raises(redis.exceptions.WatchError):
p.execute()

Expand Down

0 comments on commit b3776cd

Please sign in to comment.