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