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

Function test_acquire_release_write

tests/sqlite/test_transactions.py:32–39  ·  view source on GitHub ↗
(lock_file: str)

Source from the content-addressed store, hash-verified

30
31
32def test_acquire_release_write(lock_file: str) -> None:
33 lock = ReadWriteLock(lock_file, is_singleton=False)
34 lock.acquire_write()
35 assert (lock._hold.level, lock._hold.mode, lock._hold.write_thread_id) == (1, "write", threading.get_ident())
36 lock.release()
37 assert lock._hold.level == 0
38 assert lock._hold.mode is None
39 assert lock._hold.write_thread_id is None
40
41
42@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

acquire_writeMethod · 0.95
releaseMethod · 0.95
ReadWriteLockClass · 0.90

Tested by

no test coverage detected