From 09da3ad07f26350d093929fe1ea6eaaca79ab944 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Tue, 28 Apr 2020 13:26:19 -0700 Subject: Fix typo (missing space) in exception message (#1334) --- redis/connection.py | 2 +- tests/test_connection_pool.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/redis/connection.py b/redis/connection.py index 99c5f23..28620c3 100755 --- a/redis/connection.py +++ b/redis/connection.py @@ -1039,7 +1039,7 @@ class ConnectionPool(object): url_options['connection_class'] = SSLConnection else: valid_schemes = ', '.join(('redis://', 'rediss://', 'unix://')) - raise ValueError('Redis URL must specify one of the following' + raise ValueError('Redis URL must specify one of the following ' 'schemes (%s)' % valid_schemes) # last shot at the db value diff --git a/tests/test_connection_pool.py b/tests/test_connection_pool.py index 613ca23..080e3df 100644 --- a/tests/test_connection_pool.py +++ b/tests/test_connection_pool.py @@ -393,8 +393,12 @@ class TestConnectionPoolURLParsing(object): } def test_invalid_scheme_raises_error(self): - with pytest.raises(ValueError): + with pytest.raises(ValueError) as cm: redis.ConnectionPool.from_url('localhost') + assert str(cm.value) == ( + 'Redis URL must specify one of the following schemes ' + '(redis://, rediss://, unix://)' + ) class TestConnectionPoolUnixSocketURLParsing(object): -- cgit v1.2.1