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

Function test_recursive_lock_acquisition

tests/sqlite/test_lock.py:167–175  ·  view source on GitHub ↗
(lock_file: str, mode: Literal["read", "write"])

Source from the content-addressed store, hash-verified

165)
166@pytest.mark.timeout(PROCESS_DEADLINE * 3)
167def test_recursive_lock_acquisition(lock_file: str, mode: Literal["read", "write"]) -> None:
168 success = Value("i", 0)
169 worker = Process(target=recursive_lock, args=(lock_file, mode, success))
170
171 with cleanup_processes([worker]):
172 worker.start()
173 worker.join(timeout=PROCESS_DEADLINE)
174
175 assert success.value == 1, "Recursive lock acquisition failed"
176
177
178def recursive_lock(lock_file: str, mode: Literal["read", "write"], success_flag: Synchronized[int]) -> None:

Callers

nothing calls this directly

Calls 2

cleanup_processesFunction · 0.90
joinMethod · 0.80

Tested by

no test coverage detected