From 20c5f0fa4676c4f0fde778dae81c3f96078348b5 Mon Sep 17 00:00:00 2001 From: Chayim Date: Thu, 25 Nov 2021 15:37:58 +0200 Subject: Fixing COMMAND GETKEYS tests (#1750) --- .gitignore | 2 ++ tasks.py | 6 +++--- tests/test_commands.py | 5 +++-- tox.ini | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 05c3846..08138d7 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,5 @@ env venv coverage.xml .venv +*.xml +.coverage* diff --git a/tasks.py b/tasks.py index 138ca69..137d177 100644 --- a/tasks.py +++ b/tasks.py @@ -41,15 +41,15 @@ def tests(c): with and without hiredis. """ print("Starting Redis tests") - run("tox -e '{redis,cluster}'-'{plain,hiredis}'") + run("tox -e '{standalone,cluster}'-'{plain,hiredis}'") @task -def redis_tests(c): +def standalone_tests(c): """Run all Redis tests against the current python, with and without hiredis.""" print("Starting Redis tests") - run("tox -e redis-'{hiredis}'") + run("tox -e standalone-'{hiredis}'") @task diff --git a/tests/test_commands.py b/tests/test_commands.py index b4d371a..f526ae5 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -3796,14 +3796,15 @@ class TestRedisCommands: assert isinstance(res, int) assert res >= 100 + @pytest.mark.onlynoncluster @skip_if_server_version_lt('2.8.13') def test_command_getkeys(self, r): res = r.command_getkeys('MSET', 'a', 'b', 'c', 'd', 'e', 'f') - assert res == [b'a', b'c', b'e'] + assert res == ['a', 'c', 'e'] res = r.command_getkeys('EVAL', '"not consulted"', '3', 'key1', 'key2', 'key3', 'arg1', 'arg2', 'arg3', 'argN') - assert res == [b'key1', b'key2', b'key3'] + assert res == ['key1', 'key2', 'key3'] @skip_if_server_version_lt('2.8.13') def test_command(self, r): diff --git a/tox.ini b/tox.ini index c68dab1..0a94db8 100644 --- a/tox.ini +++ b/tox.ini @@ -3,12 +3,12 @@ addopts = -s markers = redismod: run only the redis module tests onlycluster: marks tests to be run only with cluster mode redis - onlynoncluster: marks tests to be run only with non-cluster redis + onlynoncluster: marks tests to be run only with standalone redis [tox] minversion = 3.2.0 requires = tox-docker -envlist = {redis,cluster}-{plain,hiredis}-{py35,py36,py37,py38,py39,pypy3},linters +envlist = {standalone,cluster}-{plain,hiredis}-{py35,py36,py37,py38,py39,pypy3},linters [docker:master] name = master -- cgit v1.2.1