Skip to content

Commit dbb16f4

Browse files
committed
fixed auth test
1 parent 71d7df2 commit dbb16f4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/test_commands.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import redis
1111
from redis import exceptions
1212
from redis.client import parse_info
13+
from redis.credentials import StaticCredentialProvider
1314

1415
from .conftest import (
1516
_get_client,
@@ -95,7 +96,9 @@ def teardown():
9596
# error when switching to the db 9 because we're not authenticated yet
9697
# setting the password on the connection itself triggers the
9798
# authentication in the connection's `on_connect` method
98-
r.connection.password = temp_pass
99+
r.connection.credential_provider = StaticCredentialProvider(
100+
password=temp_pass
101+
)
99102
except AttributeError:
100103
# connection field is not set in Redis Cluster, but that's ok
101104
# because the problem discussed above does not apply to Redis Cluster

0 commit comments

Comments
 (0)