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

Function test_mode_change_prohibited

tests/sqlite/test_async.py:111–122  ·  view source on GitHub ↗
(
    lock_file: str,
    held: Literal["read", "write"],
    requested: Literal["read", "write"],
    match: str,
)

Source from the content-addressed store, hash-verified

109)
110@pytest.mark.asyncio
111async def test_mode_change_prohibited(
112 lock_file: str,
113 held: Literal["read", "write"],
114 requested: Literal["read", "write"],
115 match: str,
116) -> None:
117 lock = AsyncReadWriteLock(lock_file, is_singleton=False)
118 await getattr(lock, f"acquire_{held}")()
119 with pytest.raises(RuntimeError, match=match):
120 await getattr(lock, f"acquire_{requested}")()
121 await lock.release()
122 await lock.close()
123
124
125@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

AsyncReadWriteLockClass · 0.90
releaseMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected