summaryrefslogtreecommitdiff
path: root/tests/test_connection_pool.py
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2014-05-06 22:44:19 -0700
committerAndy McCurdy <andy@andymccurdy.com>2014-05-06 22:44:19 -0700
commitef053647bb834782cde43e6d5b1f829d64646a42 (patch)
tree7c4fa321f4dca5b680549a5f47274c016165296c /tests/test_connection_pool.py
parentbb37148294e9b91c1da872a84a7bf217c15b064d (diff)
downloadredis-py-ef053647bb834782cde43e6d5b1f829d64646a42.tar.gz
SentinelManagedConnections to master servers disconnect on READONLY errors.
Any attempt to reconnect will force all connections in that pool to update their connections to the new master. Fixes #435
Diffstat (limited to 'tests/test_connection_pool.py')
-rw-r--r--tests/test_connection_pool.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_connection_pool.py b/tests/test_connection_pool.py
index c678b8e..dc74240 100644
--- a/tests/test_connection_pool.py
+++ b/tests/test_connection_pool.py
@@ -217,3 +217,9 @@ class TestConnection(object):
assert not pipe.connection
assert len(pool._available_connections) == 1
assert not pool._available_connections[0]._sock
+
+ @skip_if_server_version_lt('2.8.8')
+ def test_read_only_error(self, r):
+ "READONLY errors get turned in ReadOnlyError exceptions"
+ with pytest.raises(redis.ReadOnlyError):
+ r.execute_command('DEBUG', 'ERROR', 'READONLY blah blah')