From e22980834caf044e6917066480ac46997cd06695 Mon Sep 17 00:00:00 2001 From: Ilan Steemers Date: Wed, 2 Sep 2015 20:17:44 +0200 Subject: [PATCH] Fixes connectionerror bug on 2.7 --- django_q/brokers/disque.py | 2 +- django_q/tests/test_brokers.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/django_q/brokers/disque.py b/django_q/brokers/disque.py index d26d29b..94fb4f8 100644 --- a/django_q/brokers/disque.py +++ b/django_q/brokers/disque.py @@ -48,4 +48,4 @@ class Disque(Broker): return redis_client except redis.exceptions.ConnectionError: continue - raise ConnectionError('Could not connect to any Disque nodes') + raise redis.exceptions.ConnectionError('Could not connect to any Disque nodes') diff --git a/django_q/tests/test_brokers.py b/django_q/tests/test_brokers.py index ade1557..84fc9be 100644 --- a/django_q/tests/test_brokers.py +++ b/django_q/tests/test_brokers.py @@ -1,6 +1,7 @@ from time import sleep import pytest import os +import redis from django_q.conf import Conf from django_q.brokers import get_broker, Broker @@ -58,7 +59,7 @@ def test_disque(): sleep(1.5) assert broker.queue_size() == 0 Conf.DISQUE = ['127.0.0.1:7712', '127.0.0.1:7713'] - with pytest.raises(ConnectionError): + with pytest.raises(redis.exceptions.ConnectionError): broker.get_connection() broker.delete_queue() assert broker.queue_size() == 0