@@ -12,7 +12,7 @@ def test_redis_not_installed(self):
1212 async_redis_manager .aioredis = None
1313
1414 with pytest .raises (RuntimeError ):
15- AsyncRedisManager ('redis://' )
15+ AsyncRedisManager ('redis://' ). _redis_connect ()
1616 assert AsyncRedisManager ('unix:///var/sock/redis.sock' ) is not None
1717
1818 async_redis_manager .aioredis = saved_redis
@@ -22,7 +22,7 @@ def test_valkey_not_installed(self):
2222 async_redis_manager .aiovalkey = None
2323
2424 with pytest .raises (RuntimeError ):
25- AsyncRedisManager ('valkey://' )
25+ AsyncRedisManager ('valkey://' ). _redis_connect ()
2626 assert AsyncRedisManager ('unix:///var/sock/redis.sock' ) is not None
2727
2828 async_redis_manager .aiovalkey = saved_valkey
@@ -34,18 +34,18 @@ def test_redis_valkey_not_installed(self):
3434 async_redis_manager .aiovalkey = None
3535
3636 with pytest .raises (RuntimeError ):
37- AsyncRedisManager ('redis://' )
37+ AsyncRedisManager ('redis://' ). _redis_connect ()
3838 with pytest .raises (RuntimeError ):
39- AsyncRedisManager ('valkey://' )
39+ AsyncRedisManager ('valkey://' ). _redis_connect ()
4040 with pytest .raises (RuntimeError ):
41- AsyncRedisManager ('unix:///var/sock/redis.sock' )
41+ AsyncRedisManager ('unix:///var/sock/redis.sock' ). _redis_connect ()
4242
4343 async_redis_manager .aioredis = saved_redis
4444 async_redis_manager .aiovalkey = saved_valkey
4545
4646 def test_bad_url (self ):
4747 with pytest .raises (ValueError ):
48- AsyncRedisManager ('http://localhost:6379' )
48+ AsyncRedisManager ('http://localhost:6379' ). _redis_connect ()
4949
5050 def test_redis_connect (self ):
5151 urls = [
@@ -72,6 +72,8 @@ def test_redis_connect(self):
7272 ]
7373 for url in urls :
7474 c = AsyncRedisManager (url )
75+ assert c .redis is None
76+ c ._redis_connect ()
7577 assert isinstance (c .redis , redis .asyncio .Redis )
7678
7779 def test_valkey_connect (self ):
@@ -102,6 +104,8 @@ def test_valkey_connect(self):
102104 ]
103105 for url in urls :
104106 c = AsyncRedisManager (url )
107+ assert c .redis is None
108+ c ._redis_connect ()
105109 assert isinstance (c .redis , valkey .asyncio .Valkey )
106110
107111 async_redis_manager .aioredis = saved_redis
0 commit comments