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

Function test_sequential_lock_modes

tests/sqlite/test_lock.py:267–276  ·  view source on GitHub ↗
(
    lock_file: str,
    first: Literal["read", "write"],
    second: Literal["read", "write"],
)

Source from the content-addressed store, hash-verified

265)
266@pytest.mark.timeout(15)
267def test_sequential_lock_modes(
268 lock_file: str,
269 first: Literal["read", "write"],
270 second: Literal["read", "write"],
271) -> None:
272 lock = ReadWriteLock(lock_file)
273 for mode in (first, second):
274 with getattr(lock, f"{mode}_lock")():
275 assert not writer_gets_in(lock_file)
276 assert writer_gets_in(lock_file)
277
278
279def test_read_write_lock_keeps_constructed_database(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:

Callers

nothing calls this directly

Calls 2

ReadWriteLockClass · 0.90
writer_gets_inFunction · 0.90

Tested by

no test coverage detected