Skip to content

Commit

Permalink
tagging tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chayim committed May 15, 2023
1 parent e1126a3 commit e480322
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/version_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
pytest -m "not onlycluster and not redismod and not ssl and not replica" --redis-url=${{matrix.redis-url}}
5 changes: 4 additions & 1 deletion tests/test_asyncio/test_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
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()
Expand Down Expand Up @@ -54,6 +54,7 @@ def get_credentials(self) -> Union[Tuple[str], Tuple[str, str]]:
return "username", ""


@skip_if_server_version_lt("6.0.0")
class AsyncRandomAuthCredProvider(CredentialProvider):
def __init__(self, user: Optional[str], endpoint: str):
self.user = user
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -252,6 +254,7 @@ async def test_change_username_password_on_existing_connection(


@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
Expand Down
1 change: 1 addition & 0 deletions tests/test_command_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def test_get_keys_predetermined_key_location(self, r):
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)
Expand Down
4 changes: 4 additions & 0 deletions tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def test_case_insensitive_command_names(self, r):

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
Expand Down Expand Up @@ -806,6 +807,9 @@ def test_lolwut(self, r):
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

Expand Down
6 changes: 4 additions & 2 deletions tests/test_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
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):
Expand Down Expand Up @@ -97,8 +97,9 @@ def teardown():

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)
Expand Down Expand Up @@ -215,6 +216,7 @@ def test_change_username_password_on_existing_connection(self, r, request):
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"
Expand Down

0 comments on commit e480322

Please sign in to comment.