summaryrefslogtreecommitdiff
path: root/tests/test_connection_pool.py
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2014-04-21 00:29:56 -0700
committerAndy McCurdy <andy@andymccurdy.com>2014-04-21 00:29:56 -0700
commitca9f228da156df41d8c833a01da8551848629ee4 (patch)
tree1e0a776657ccb8ff254e84ee9db448cc15f5650f /tests/test_connection_pool.py
parentf96e46b971a5bb66ab5f94ba87ab3e092e5f01ac (diff)
downloadredis-py-ca9f228da156df41d8c833a01da8551848629ee4.tar.gz
better error handling with hiredis. fully fixes #456
Diffstat (limited to 'tests/test_connection_pool.py')
-rw-r--r--tests/test_connection_pool.py29
1 files changed, 14 insertions, 15 deletions
diff --git a/tests/test_connection_pool.py b/tests/test_connection_pool.py
index b4b6268..c678b8e 100644
--- a/tests/test_connection_pool.py
+++ b/tests/test_connection_pool.py
@@ -203,18 +203,17 @@ class TestConnection(object):
assert len(pool._available_connections) == 1
assert not pool._available_connections[0]._sock
- # TODO: This fails on hiredis. need to think about this
- # @skip_if_server_version_lt('2.8.8')
- # def test_busy_loading_from_pipeline(self, r):
- # """
- # BusyLoadingErrors should be raised from a pipeline execution
- # regardless of the raise_on_error flag.
- # """
- # pipe = r.pipeline()
- # pipe.execute_command('DEBUG', 'ERROR', 'LOADING fake message')
- # with pytest.raises(redis.BusyLoadingError):
- # pipe.execute()
- # pool = r.connection_pool
- # 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_busy_loading_from_pipeline(self, r):
+ """
+ BusyLoadingErrors should be raised from a pipeline execution
+ regardless of the raise_on_error flag.
+ """
+ pipe = r.pipeline()
+ pipe.execute_command('DEBUG', 'ERROR', 'LOADING fake message')
+ with pytest.raises(redis.BusyLoadingError):
+ pipe.execute()
+ pool = r.connection_pool
+ assert not pipe.connection
+ assert len(pool._available_connections) == 1
+ assert not pool._available_connections[0]._sock