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

Function test_non_blocking_conflict

tests/sqlite/test_async.py:133–144  ·  view source on GitHub ↗
(
    lock_file: str, mode: Literal["read", "write"], held: Literal["read", "write"]
)

Source from the content-addressed store, hash-verified

131)
132@pytest.mark.asyncio
133async def test_non_blocking_conflict(
134 lock_file: str, mode: Literal["read", "write"], held: Literal["read", "write"]
135) -> None:
136 holder = ReadWriteLock(lock_file, is_singleton=False)
137 getattr(holder, f"acquire_{held}")()
138 try:
139 lock = AsyncReadWriteLock(lock_file, is_singleton=False)
140 with pytest.raises(Timeout):
141 await getattr(lock, f"acquire_{mode}")(blocking=False)
142 await lock.close()
143 finally:
144 holder.release()
145
146
147@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 4

releaseMethod · 0.95
ReadWriteLockClass · 0.90
AsyncReadWriteLockClass · 0.90
closeMethod · 0.45

Tested by

no test coverage detected