summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2020-07-20 13:26:15 -0700
committerAndy McCurdy <andy@andymccurdy.com>2020-07-20 13:26:15 -0700
commitf24b7f2b66172f9df7143b57d324ffb41bca979b (patch)
treeb20bbfb8380ca736e4c646a0cdc57c37c6a249e4
parenta4ccbe471b9bd2c1ec86bf6d5b08a110088e4161 (diff)
downloadredis-py-f24b7f2b66172f9df7143b57d324ffb41bca979b.tar.gz
make the slowlog_get test more resilient to multiple clients being connected
-rw-r--r--tests/test_commands.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/test_commands.py b/tests/test_commands.py
index 65e877c..1f2c97d 100644
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -433,12 +433,10 @@ class TestRedisCommands(object):
def test_slowlog_get_limit(self, r, slowlog):
assert r.slowlog_reset()
r.get('foo')
- r.get('bar')
slowlog = r.slowlog_get(1)
assert isinstance(slowlog, list)
- commands = [log['command'] for log in slowlog]
- assert b'GET foo' not in commands
- assert b'GET bar' in commands
+ # only one command, based on the number we passed to slowlog_get()
+ assert len(slowlog) == 1
def test_slowlog_length(self, r, slowlog):
r.get('foo')