summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChayim I. Kirshen <c@kirshen.com>2023-05-15 16:34:56 +0300
committerChayim I. Kirshen <c@kirshen.com>2023-05-15 16:34:56 +0300
commite48032227242bc1d27b6159ffddd73d724770ab5 (patch)
tree76817edf73c8b3632b0a22f8780541350e37e849
parente1126a37b510a339fa6c5f3636c07fb9bd6e0d11 (diff)
downloadredis-py-e48032227242bc1d27b6159ffddd73d724770ab5.tar.gz
tagging tests
-rw-r--r--.github/workflows/version_coverage.yml2
-rw-r--r--tests/test_asyncio/test_credentials.py5
-rw-r--r--tests/test_command_parser.py1
-rw-r--r--tests/test_commands.py4
-rw-r--r--tests/test_credentials.py6
5 files changed, 14 insertions, 4 deletions
diff --git a/.github/workflows/version_coverage.yml b/.github/workflows/version_coverage.yml
index de16d6b..154f677 100644
--- a/.github/workflows/version_coverage.yml
+++ b/.github/workflows/version_coverage.yml
@@ -65,4 +65,4 @@ jobs:
pip install -U setuptools wheel
pip install -r dev_requirements.txt
pip install -r requirements.txt
- pytest -m "not onlycluster and not redismod and not ssl" --redis-url=${{matrix.redis-url}} \ No newline at end of file
+ pytest -m "not onlycluster and not redismod and not ssl and not replica" --redis-url=${{matrix.redis-url}} \ No newline at end of file
diff --git a/tests/test_asyncio/test_credentials.py b/tests/test_asyncio/test_credentials.py
index 8e213cd..71c3a42 100644
--- a/tests/test_asyncio/test_credentials.py
+++ b/tests/test_asyncio/test_credentials.py
@@ -10,7 +10,7 @@ import redis
from redis import AuthenticationError, DataError, ResponseError
from redis.credentials import CredentialProvider, UsernamePasswordCredentialProvider
from redis.utils import str_if_bytes
-from tests.conftest import skip_if_redis_enterprise
+from tests.conftest import skip_if_redis_enterprise, skip_if_server_version_lt
@pytest_asyncio.fixture()
@@ -54,6 +54,7 @@ class NoPassCredProvider(CredentialProvider):
return "username", ""
+@skip_if_server_version_lt("6.0.0")
class AsyncRandomAuthCredProvider(CredentialProvider):
def __init__(self, user: Optional[str], endpoint: str):
self.user = user
@@ -120,6 +121,7 @@ async def init_required_pass(r, password):
@pytest.mark.asyncio
+@skip_if_server_version_lt("6.0.0")
class TestCredentialsProvider:
@skip_if_redis_enterprise()
async def test_only_pass_without_creds_provider(
@@ -252,6 +254,7 @@ class TestCredentialsProvider:
@pytest.mark.asyncio
+@skip_if_server_version_lt("6.0.0")
class TestUsernamePasswordCredentialProvider:
async def test_user_pass_credential_provider_acl_user_and_pass(
self, r_acl_teardown, create_redis
diff --git a/tests/test_command_parser.py b/tests/test_command_parser.py
index b2a2268..90c6fbf 100644
--- a/tests/test_command_parser.py
+++ b/tests/test_command_parser.py
@@ -21,6 +21,7 @@ class TestCommandsParser:
assert commands_parser.get_keys(r, *args3) == ["foo", "bar", "foobar"]
@pytest.mark.filterwarnings("ignore:ResponseError")
+ @pytest.mark.skip_if_server_version_lt("6.0.0")
@skip_if_redis_enterprise()
def test_get_moveable_keys(self, r):
commands_parser = CommandsParser(r)
diff --git a/tests/test_commands.py b/tests/test_commands.py
index 1af69c8..b8e830a 100644
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -68,6 +68,7 @@ class TestResponseCallbacks:
class TestRedisCommands:
@skip_if_redis_enterprise()
+ @skip_if_server_version_lt("6.0.0")
def test_auth(self, r, request):
# sending an AUTH command before setting a user/password on the
# server should return an AuthenticationError
@@ -806,6 +807,9 @@ class TestRedisCommands:
lolwut = r.lolwut().decode("utf-8")
assert "Redis ver." in lolwut
+ @pytest.mark.onlynoncluster
+ @skip_if_server_version_lt("6.0.0")
+ def test_lolwut_newer(self, r):
lolwut = r.lolwut(5, 6, 7, 8).decode("utf-8")
assert "Redis ver." in lolwut
diff --git a/tests/test_credentials.py b/tests/test_credentials.py
index 9aeb1ef..27e942c 100644
--- a/tests/test_credentials.py
+++ b/tests/test_credentials.py
@@ -9,7 +9,7 @@ import redis
from redis import AuthenticationError, DataError, ResponseError
from redis.credentials import CredentialProvider, UsernamePasswordCredentialProvider
from redis.utils import str_if_bytes
-from tests.conftest import _get_client, skip_if_redis_enterprise
+from tests.conftest import _get_client, skip_if_redis_enterprise, skip_if_server_version_lt
class NoPassCredProvider(CredentialProvider):
@@ -97,8 +97,9 @@ def init_required_pass(r, request, password):
request.addfinalizer(teardown)
-
+@skip_if_server_version_lt("6.0.0")
class TestCredentialsProvider:
+
@skip_if_redis_enterprise()
def test_only_pass_without_creds_provider(self, r, request):
# test for default user (`username` is supposed to be optional)
@@ -215,6 +216,7 @@ class TestCredentialsProvider:
assert str_if_bytes(conn.read_response()) == "PONG"
+@skip_if_server_version_lt("6.0.0")
class TestUsernamePasswordCredentialProvider:
def test_user_pass_credential_provider_acl_user_and_pass(self, r, request):
username = "username"