diff options
Diffstat (limited to 'tests/test_pubsub.py')
-rw-r--r-- | tests/test_pubsub.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_pubsub.py b/tests/test_pubsub.py index fc91abf..7f94b4a 100644 --- a/tests/test_pubsub.py +++ b/tests/test_pubsub.py @@ -490,3 +490,16 @@ class TestPubSubPings(object): assert wait_for_message(p) == make_message(type='pong', channel=None, data='hello world', pattern=None) + + +class TestPubSubConnectionKilled(object): + + @skip_if_server_version_lt('3.0.0') + def test_connection_error_raised_when_connection_dies(self, r): + p = r.pubsub(ignore_subscribe_messages=True) + p.subscribe('foo') + for client in r.client_list(): + if client['cmd'] == 'subscribe': + r.client_kill_filter(_id=client['id']) + with pytest.raises(ConnectionError): + wait_for_message(p) |