Skip to content

Commit 09da3ad

Browse files
authored
Fix typo (missing space) in exception message (#1334)
1 parent 05548a3 commit 09da3ad

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

redis/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ def from_url(cls, url, db=None, decode_components=False, **kwargs):
10391039
url_options['connection_class'] = SSLConnection
10401040
else:
10411041
valid_schemes = ', '.join(('redis://', 'rediss://', 'unix://'))
1042-
raise ValueError('Redis URL must specify one of the following'
1042+
raise ValueError('Redis URL must specify one of the following '
10431043
'schemes (%s)' % valid_schemes)
10441044

10451045
# last shot at the db value

tests/test_connection_pool.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,12 @@ def test_client_creates_connection_pool(self):
393393
}
394394

395395
def test_invalid_scheme_raises_error(self):
396-
with pytest.raises(ValueError):
396+
with pytest.raises(ValueError) as cm:
397397
redis.ConnectionPool.from_url('localhost')
398+
assert str(cm.value) == (
399+
'Redis URL must specify one of the following schemes '
400+
'(redis://, rediss://, unix://)'
401+
)
398402

399403

400404
class TestConnectionPoolUnixSocketURLParsing(object):

0 commit comments

Comments
 (0)