MCPcopy Create free account
hub / github.com/tox-dev/filelock / test_sequential_mode_switch

Function test_sequential_mode_switch

tests/sqlite/test_async.py:234–243  ·  view source on GitHub ↗
(lock_file: str)

Source from the content-addressed store, hash-verified

232
233@pytest.mark.asyncio
234async def test_sequential_mode_switch(lock_file: str) -> None:
235 lock = AsyncReadWriteLock(lock_file, is_singleton=False)
236 async with lock.read_lock():
237 assert not await asyncio.to_thread(writer_gets_in, lock_file)
238 async with lock.write_lock():
239 assert not await asyncio.to_thread(writer_gets_in, lock_file)
240 async with lock.read_lock():
241 assert not await asyncio.to_thread(writer_gets_in, lock_file)
242 await lock.close()
243 assert writer_gets_in(lock_file)

Callers

nothing calls this directly

Calls 5

read_lockMethod · 0.95
write_lockMethod · 0.95
AsyncReadWriteLockClass · 0.90
writer_gets_inFunction · 0.90
closeMethod · 0.45

Tested by

no test coverage detected