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

Function test_sequential_mode_switch

tests/test_read_write_unit.py:285–292  ·  view source on GitHub ↗
(lock_file: str, first: str, second: str)

Source from the content-addressed store, hash-verified

283 ],
284)
285def test_sequential_mode_switch(lock_file: str, first: str, second: str) -> None:
286 lock = ReadWriteLock(lock_file, is_singleton=False)
287 first_ctx = lock.read_lock() if first == "read" else lock.write_lock()
288 second_ctx = lock.read_lock() if second == "read" else lock.write_lock()
289 with first_ctx:
290 pass
291 with second_ctx:
292 pass
293
294
295def test_non_blocking_read_fails_when_write_held(lock_file: str) -> None:

Callers

nothing calls this directly

Calls 3

read_lockMethod · 0.95
write_lockMethod · 0.95
ReadWriteLockClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…