diff --git a/tests/test_asyncio/test_connection_pool.py b/tests/test_asyncio/test_connection_pool.py index e63f3f51..8d384bf5 100644 --- a/tests/test_asyncio/test_connection_pool.py +++ b/tests/test_asyncio/test_connection_pool.py @@ -666,7 +666,11 @@ async def test_connect_no_auth_supplied_when_required(self, r): """ with pytest.raises(valkey.AuthenticationError): await r.execute_command( - "DEBUG", "ERROR", "ERR Client sent AUTH, but no password is set" + "DEBUG", + "ERROR", + "ERR AUTH called without any password " + "configured for the default user. Are you sure " + "your configuration is correct?", ) async def test_connect_invalid_password_supplied(self, r): diff --git a/tests/test_connection_pool.py b/tests/test_connection_pool.py index 53bec1e4..5cb1dba4 100644 --- a/tests/test_connection_pool.py +++ b/tests/test_connection_pool.py @@ -583,13 +583,6 @@ def test_connect_no_auth_configured(self, r): AuthenticationError should be raised when the server is not configured with auth but credentials are supplied by the user. """ - # Redis < 6 - with pytest.raises(valkey.AuthenticationError): - r.execute_command( - "DEBUG", "ERROR", "ERR Client sent AUTH, but no password is set" - ) - - # Redis >= 6 with pytest.raises(valkey.AuthenticationError): r.execute_command( "DEBUG", diff --git a/valkey/_parsers/base.py b/valkey/_parsers/base.py index f7f9b6e8..a123acbc 100644 --- a/valkey/_parsers/base.py +++ b/valkey/_parsers/base.py @@ -35,14 +35,11 @@ "types, can't unload" ) # user send an AUTH cmd to a server without authorization configured -NO_AUTH_SET_ERROR = { - # Redis >= 6.0 +NO_AUTH_SET_ERROR = ( "AUTH called without any password " "configured for the default user. Are you sure " - "your configuration is correct?": AuthenticationError, - # Redis < 6.0 - "Client sent AUTH, but no password is set": AuthenticationError, -} + "your configuration is correct?" +) class BaseParser(ABC): @@ -62,7 +59,7 @@ class BaseParser(ABC): MODULE_EXPORTS_DATA_TYPES_ERROR: ModuleError, NO_SUCH_MODULE_ERROR: ModuleError, MODULE_UNLOAD_NOT_POSSIBLE_ERROR: ModuleError, - **NO_AUTH_SET_ERROR, + NO_AUTH_SET_ERROR: AuthenticationError, }, "OOM": OutOfMemoryError, "WRONGPASS": AuthenticationError,