Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions redis/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,14 @@ def client_unpause(self, **kwargs):
"""
return self.execute_command("CLIENT UNPAUSE", **kwargs)

def client_no_evict(self, mode: str) -> str:
"""
Sets the client eviction mode for the current connection.

For more information check https://redis.io/commands/client-no-evict
"""
return self.execute_command("CLIENT NO-EVICT", mode)

def command(self, **kwargs):
"""
Returns dict reply of details about all Redis commands.
Expand Down
7 changes: 7 additions & 0 deletions tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,13 @@ def test_client_pause_all(self, r, r2):
def test_client_unpause(self, r):
assert r.client_unpause() == b"OK"

@pytest.mark.onlynoncluster
# @skip_if_server_version_lt("7.0.0") turn on after redis 7 release
def test_client_no_evict(self, unstable_r):
assert unstable_r.client_no_evict("ON") == b"OK"
with pytest.raises(TypeError):
unstable_r.client_no_evict()

@pytest.mark.onlynoncluster
@skip_if_server_version_lt("3.2.0")
def test_client_reply(self, r, r_timeout):
Expand Down