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

Function test_reentrant_write

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

Source from the content-addressed store, hash-verified

91
92@pytest.mark.asyncio
93async def test_reentrant_write(lock_file: str) -> None:
94 lock = AsyncReadWriteLock(lock_file, is_singleton=False)
95 await lock.acquire_write()
96 await lock.acquire_write()
97 assert lock._lock._lock_level == 2
98 await lock.release()
99 assert lock._lock._lock_level == 1
100 assert lock._lock._current_mode == "write"
101 await lock.release()
102 assert lock._lock._lock_level == 0
103
104
105@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 3

acquire_writeMethod · 0.95
releaseMethod · 0.95
AsyncReadWriteLockClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…