Skip to content

Commit 500418f

Browse files
committed
renaming
1 parent 0e17b08 commit 500418f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/service-library/tests/redis/test_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ async def redis_client_sdk(
5555

5656

5757
@pytest.fixture
58-
def lock_timeout() -> datetime.timedelta:
58+
def redis_lock_ttl() -> datetime.timedelta:
5959
return datetime.timedelta(seconds=1)
6060

6161

6262
@pytest.fixture
63-
def mock_default_lock_ttl(mocker: MockerFixture) -> None:
63+
def with_short_default_redis_lock_ttl(mocker: MockerFixture) -> None:
6464
mocker.patch.object(
6565
redis_constants, "DEFAULT_LOCK_TTL", datetime.timedelta(seconds=0.25)
6666
)
@@ -134,10 +134,10 @@ async def test_redis_lock_context_manager(
134134

135135

136136
async def test_redis_lock_with_ttl(
137-
redis_client_sdk: RedisClientSDK, faker: Faker, lock_timeout: datetime.timedelta
137+
redis_client_sdk: RedisClientSDK, faker: Faker, redis_lock_ttl: datetime.timedelta
138138
):
139139
ttl_lock = redis_client_sdk.redis.lock(
140-
faker.pystr(), timeout=lock_timeout.total_seconds()
140+
faker.pystr(), timeout=redis_lock_ttl.total_seconds()
141141
)
142142
assert not await ttl_lock.locked()
143143

@@ -146,7 +146,7 @@ async def test_redis_lock_with_ttl(
146146
async with ttl_lock:
147147
assert await ttl_lock.locked()
148148
assert await ttl_lock.owned()
149-
await asyncio.sleep(2 * lock_timeout.total_seconds())
149+
await asyncio.sleep(2 * redis_lock_ttl.total_seconds())
150150
assert not await ttl_lock.locked()
151151

152152

@@ -206,7 +206,7 @@ async def test_lock_context_released_after_error(
206206

207207

208208
async def test_lock_acquired_in_parallel_to_update_same_resource(
209-
mock_default_lock_ttl: None,
209+
with_short_default_redis_lock_ttl: None,
210210
get_redis_client_sdk: Callable[
211211
[RedisDatabase], AbstractAsyncContextManager[RedisClientSDK]
212212
],

0 commit comments

Comments
 (0)