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

Function test_reentrant_read

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

Source from the content-addressed store, hash-verified

78
79@pytest.mark.asyncio
80async def test_reentrant_read(lock_file: str) -> None:
81 lock = AsyncReadWriteLock(lock_file, is_singleton=False)
82 await lock.acquire_read()
83 await lock.acquire_read()
84 assert lock._lock._lock_level == 2
85 await lock.release()
86 assert lock._lock._lock_level == 1
87 assert lock._lock._current_mode == "read"
88 await lock.release()
89 assert lock._lock._lock_level == 0
90
91
92@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 3

acquire_readMethod · 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…