File tree Expand file tree Collapse file tree 2 files changed +16
-12
lines changed
packages/service-library/tests/deferred_tasks Expand file tree Collapse file tree 2 files changed +16
-12
lines changed Original file line number Diff line number Diff line change 1- from collections .abc import AsyncIterator , Callable
2- from contextlib import AbstractAsyncContextManager
1+ from collections .abc import AsyncIterator
32
43import pytest
54from servicelib .redis import RedisClientSDK
6- from settings_library .redis import RedisDatabase
5+ from settings_library .redis import RedisDatabase , RedisSettings
76
87
98@pytest .fixture
109async def redis_client_sdk_deferred_tasks (
11- get_redis_client_sdk : Callable [
12- [RedisDatabase , bool ], AbstractAsyncContextManager [RedisClientSDK ]
13- ]
10+ redis_service : RedisSettings ,
1411) -> AsyncIterator [RedisClientSDK ]:
15- async with get_redis_client_sdk (
16- RedisDatabase .DEFERRED_TASKS , decode_response = False
17- ) as client :
18- yield client
12+
13+ client = RedisClientSDK (
14+ redis_service .build_redis_dsn (RedisDatabase .DEFERRED_TASKS ),
15+ decode_responses = False ,
16+ client_name = "pytest-deferred_tasks" ,
17+ )
18+ await client .setup ()
19+
20+ yield client
21+
22+ await client .shutdown ()
Original file line number Diff line number Diff line change @@ -50,10 +50,10 @@ class MockKeys(StrAutoEnum):
5050
5151@pytest .fixture
5252async def redis_client_sdk (
53- use_in_memory_redis : RedisSettings ,
53+ redis_service : RedisSettings ,
5454) -> AsyncIterable [RedisClientSDK ]:
5555 sdk = RedisClientSDK (
56- use_in_memory_redis .build_redis_dsn (RedisDatabase .DEFERRED_TASKS ),
56+ redis_service .build_redis_dsn (RedisDatabase .DEFERRED_TASKS ),
5757 decode_responses = False ,
5858 client_name = "pytest" ,
5959 )
You can’t perform that action at this time.
0 commit comments