diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2018-11-02 15:58:26 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-02 15:58:26 -0700 |
commit | a0482156f4166cb7e44d14b57bdd18026acd3f15 (patch) | |
tree | 5969621fb34ba6c1cefbfe6e228b819e53d5aae6 | |
parent | b67456a8687bed78093e68e4d1814850d167fbd5 (diff) | |
parent | eb6a34dab4d316a7c8ea186775321458e033e3d3 (diff) | |
download | redis-py-a0482156f4166cb7e44d14b57bdd18026acd3f15.tar.gz |
Merge pull request #985 from mmaslowskicc/from-url-max-connections
Fix parsing max_connections URL query string parameter
-rwxr-xr-x | redis/connection.py | 3 | ||||
-rw-r--r-- | tests/test_connection_pool.py | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/redis/connection.py b/redis/connection.py index 9893191..00c3311 100755 --- a/redis/connection.py +++ b/redis/connection.py @@ -779,7 +779,8 @@ URL_QUERY_ARGUMENT_PARSERS = { 'socket_timeout': float, 'socket_connect_timeout': float, 'socket_keepalive': to_bool, - 'retry_on_timeout': to_bool + 'retry_on_timeout': to_bool, + 'max_connections': int, } diff --git a/tests/test_connection_pool.py b/tests/test_connection_pool.py index 11c2008..56a73fe 100644 --- a/tests/test_connection_pool.py +++ b/tests/test_connection_pool.py @@ -240,7 +240,7 @@ class TestConnectionPoolURLParsing(object): def test_extra_typed_querystring_options(self): pool = redis.ConnectionPool.from_url( 'redis://localhost/2?socket_timeout=20&socket_connect_timeout=10' - '&socket_keepalive=&retry_on_timeout=Yes' + '&socket_keepalive=&retry_on_timeout=Yes&max_connections=10' ) assert pool.connection_class == redis.Connection @@ -253,6 +253,7 @@ class TestConnectionPoolURLParsing(object): 'retry_on_timeout': True, 'password': None, } + assert pool.max_connections == 10 def test_boolean_parsing(self): for expected, value in ( |