diff options
-rw-r--r-- | redis/commands/core.py | 6 | ||||
-rw-r--r-- | tests/test_commands.py | 8 |
2 files changed, 12 insertions, 2 deletions
diff --git a/redis/commands/core.py b/redis/commands/core.py index 1d0be8a..e6ab009 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -900,7 +900,9 @@ class ManagementCommands(CommandsProtocol): """ return self.execute_command("SELECT", index, **kwargs) - def info(self, section: Union[str, None] = None, **kwargs) -> ResponseT: + def info( + self, section: Union[str, None] = None, *args: List[str], **kwargs + ) -> ResponseT: """ Returns a dictionary containing information about the Redis server @@ -915,7 +917,7 @@ class ManagementCommands(CommandsProtocol): if section is None: return self.execute_command("INFO", **kwargs) else: - return self.execute_command("INFO", section, **kwargs) + return self.execute_command("INFO", section, *args, **kwargs) def lastsave(self, **kwargs) -> ResponseT: """ diff --git a/tests/test_commands.py b/tests/test_commands.py index aa29e6f..05a90f2 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -728,6 +728,14 @@ class TestRedisCommands: assert "redis_version" in info.keys() @pytest.mark.onlynoncluster + @skip_if_server_version_lt("7.0.0") + def test_info_multi_sections(self, r): + res = r.info("clients", "server") + assert isinstance(res, dict) + assert "redis_version" in res + assert "connected_clients" in res + + @pytest.mark.onlynoncluster @skip_if_redis_enterprise() def test_lastsave(self, r): assert isinstance(r.lastsave(), datetime.datetime) |