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:205–212  ·  view source on GitHub ↗
(lock_file: str, mode: Literal["read", "write"])

Source from the content-addressed store, hash-verified

203 ],
204)
205def test_lock_context_manager(lock_file: str, mode: Literal["read", "write"]) -> None:
206 lock = ReadWriteLock(lock_file, is_singleton=False)
207 ctx = lock.read_lock() if mode == "read" else lock.write_lock()
208 with ctx:
209 assert lock._lock_level == 1
210 assert lock._current_mode == mode
211 assert lock._lock_level == 0
212 assert lock._current_mode is None
213
214
215@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

Used in the wild real call sites across dependent graphs

searching dependent graphs…