summaryrefslogtreecommitdiff
path: root/tests/test_pipeline.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_pipeline.py')
-rw-r--r--tests/test_pipeline.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_pipeline.py b/tests/test_pipeline.py
index 828b989..088071b 100644
--- a/tests/test_pipeline.py
+++ b/tests/test_pipeline.py
@@ -172,6 +172,21 @@ class TestPipeline(object):
assert pipe.set('z', 'zzz').execute() == [True]
assert r['z'] == b'zzz'
+ def test_parse_error_raised_transaction(self, r):
+ with r.pipeline() as pipe:
+ pipe.multi()
+ # the zrem is invalid because we don't pass any keys to it
+ pipe.set('a', 1).zrem('b').set('b', 2)
+ with pytest.raises(redis.ResponseError) as ex:
+ pipe.execute()
+
+ assert unicode(ex.value).startswith('Command # 2 (ZREM b) of '
+ 'pipeline caused error: ')
+
+ # make sure the pipe was restored to a working state
+ assert pipe.set('z', 'zzz').execute() == [True]
+ assert r['z'] == b'zzz'
+
def test_watch_succeed(self, r):
r['a'] = 1
r['b'] = 2