diff --git a/redislite/client.py b/redislite/client.py index 72aa5a7..af08bf1 100644 --- a/redislite/client.py +++ b/redislite/client.py @@ -278,7 +278,7 @@ def __init__(self, *args, **kwargs): # If the user is specifying settings we can't configure just pass the # request to the redis.Redis module if 'host' in kwargs.keys() or 'port' in kwargs.keys(): - super(RedisMixin, self).__init__(*args, **kwargs) # pragma: no cover + return super(RedisMixin, self).__init__(*args, **kwargs) # pragma: no cover self.socket_file = kwargs.get('unix_socket_path', None) if self.socket_file and self.socket_file == os.path.basename(self.socket_file): diff --git a/tests/test_client.py b/tests/test_client.py index aed2959..3bd4d80 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -15,6 +15,7 @@ import stat import tempfile import unittest +from redis.exceptions import ConnectionError logger = logging.getLogger(__name__) @@ -268,6 +269,16 @@ def test_connection_count_multiple(self): s = redislite.Redis(r.db) self.assertEqual(r._connection_count(), 2) + def test_connection_fallthrough(self): + """ + Create a connection with an argument that will cause redislite + to pass it to the redis module. This should generate an exception + since there is no redis server running on the port. + :return: + """ + with self.assertRaises(ConnectionError): + redislite.Redis(port=1).keys() + if __name__ == '__main__': logging.basicConfig(level=logging.DEBUG) diff --git a/tox.ini b/tox.ini index 8ca944a..27deb69 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ skip_missing_interpreters=True # Removed pypy3 due to issues with the psutil dependency on that python # version. #envlist = py27,py33,py34,pypy,pypy3 -envlist = py27,py33,py34,pypy +envlist = py27,py33,py34,py35,pypy [testenv] deps=