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

Function test_recursive_write_lock_acquisition

tests/test_read_write.py:437–446  ·  view source on GitHub ↗

Test that the same process can acquire the same write lock multiple times.

(lock_file: str)

Source from the content-addressed store, hash-verified

435
436@pytest.mark.timeout(10)
437def test_recursive_write_lock_acquisition(lock_file: str) -> None:
438 """Test that the same process can acquire the same write lock multiple times."""
439 success = Value("i", 0)
440 worker = Process(target=recursive_write_lock, args=(lock_file, success))
441
442 with cleanup_processes([worker]):
443 worker.start()
444 worker.join(timeout=5)
445
446 assert success.value == 1, "Recursive write lock acquisition failed"
447
448
449def acquire_write_lock_and_crash(lock_file: str, acquired_event: EventType) -> None:

Callers

nothing calls this directly

Calls 2

cleanup_processesFunction · 0.85
joinMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…