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:299–304  ·  view source on GitHub ↗
(lock_file: str, first: str, second: str)

Source from the content-addressed store, hash-verified

297 ],
298)
299def test_sequential_mode_switch(lock_file: str, first: str, second: str) -> None:
300 lock = ReadWriteLock(lock_file, is_singleton=False)
301 with lock.read_lock() if first == "read" else lock.write_lock():
302 pass
303 with lock.read_lock() if second == "read" else lock.write_lock():
304 pass
305
306
307def 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