File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
packages/service-library/tests Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -170,17 +170,14 @@ async def test_issue_cannot_acquire_lock_anymore(
170170 redis_client_sdk : RedisClientSDK , faker : Faker
171171):
172172 lock_name = faker .pystr ()
173- with pytest .raises (LockLostError ):
173+ with pytest .raises (LockLostError ): # noqa: PT012
174174 async with redis_client_sdk .lock_context (lock_name ) as ttl_lock :
175175 assert await _is_locked (redis_client_sdk , lock_name ) is True
176176 assert await ttl_lock .owned () is True
177- # let's force release the lock
178- await redis_client_sdk ._client .delete (lock_name )
179-
177+ # let's simlulate lost lock by forcefully deleting it
178+ await redis_client_sdk ._client .delete (lock_name ) # noqa: SLF001
179+ # now we wait for the exception to be raised
180180 await asyncio .sleep (20 )
181- # assert await _is_locked(redis_client_sdk, lock_name) is False
182- # assert await ttl_lock.owned() is False
183- # actually it should even raise here
184181
185182
186183async def test_lock_context_with_already_locked_lock_raises (
You can’t perform that action at this time.
0 commit comments