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

Function test_sequential_mode_switch

tests/test_async_read_write.py:280–288  ·  view source on GitHub ↗
(lock_file: str)

Source from the content-addressed store, hash-verified

278
279@pytest.mark.asyncio
280async def test_sequential_mode_switch(lock_file: str) -> None:
281 lock = AsyncReadWriteLock(lock_file, is_singleton=False)
282 async with lock.read_lock():
283 pass
284 async with lock.write_lock():
285 pass
286 async with lock.read_lock():
287 pass
288 await lock.close()
289
290
291def assert_mode_held(lock_file: str, mode: Literal["read", "write"]) -> None:

Callers

nothing calls this directly

Calls 4

read_lockMethod · 0.95
write_lockMethod · 0.95
closeMethod · 0.95
AsyncReadWriteLockClass · 0.90

Tested by

no test coverage detected