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

Function test_lock_context_manager

tests/test_read_write_unit.py:215–221  ·  view source on GitHub ↗
(lock_file: str, mode: Literal["read", "write"])

Source from the content-addressed store, hash-verified

213 ],
214)
215def test_lock_context_manager(lock_file: str, mode: Literal["read", "write"]) -> None:
216 lock = ReadWriteLock(lock_file, is_singleton=False)
217 with lock.read_lock() if mode == "read" else lock.write_lock():
218 assert lock._lock_level == 1
219 assert lock._current_mode == mode
220 assert lock._lock_level == 0
221 assert lock._current_mode is None
222
223
224@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

read_lockMethod · 0.95
write_lockMethod · 0.95
ReadWriteLockClass · 0.90

Tested by

no test coverage detected