diff --git a/redis/connection.py b/redis/connection.py index 1f862d0371..61ef1e8ffa 100644 --- a/redis/connection.py +++ b/redis/connection.py @@ -956,6 +956,7 @@ def to_bool(value): "health_check_interval": int, "ssl_check_hostname": to_bool, "timeout": float, + "is_master": to_bool, } diff --git a/tests/test_connection_pool.py b/tests/test_connection_pool.py index dee7c554d3..c2a590c5c4 100644 --- a/tests/test_connection_pool.py +++ b/tests/test_connection_pool.py @@ -321,6 +321,11 @@ def test_extra_querystring_options(self): assert pool.connection_class == redis.Connection assert pool.connection_kwargs == {"host": "localhost", "a": "1", "b": "2"} + def test_ismaster_querystring(self): + pool = redis.ConnectionPool.from_url("redis://localhost?1&ismaster=0") + assert pool.connection_class == redis.Connection + assert pool.connection_kwargs == {"host": "localhost", "db": 1,"ismaster": False} + def test_calling_from_subclass_returns_correct_instance(self): pool = redis.BlockingConnectionPool.from_url("redis://localhost") assert isinstance(pool, redis.BlockingConnectionPool)