| 121 | assert r["z"] == b"zzz" |
| 122 | |
| 123 | def test_exec_error_raised(self, r): |
| 124 | r["c"] = "a" |
| 125 | with r.pipeline() as pipe: |
| 126 | pipe.set("a", 1).set("b", 2).lpush("c", 3).set("d", 4) |
| 127 | with pytest.raises(redis.ResponseError) as ex: |
| 128 | pipe.execute() |
| 129 | assert str(ex.value).startswith( |
| 130 | "Command # 3 (LPUSH c 3) of pipeline caused error: " |
| 131 | ) |
| 132 | |
| 133 | # make sure the pipe was restored to a working state |
| 134 | assert pipe.set("z", "zzz").execute() == [True] |
| 135 | assert r["z"] == b"zzz" |
| 136 | |
| 137 | @pytest.mark.onlynoncluster |
| 138 | def test_transaction_with_empty_error_command(self, r): |