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

Function test_lock_context_manager

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

Source from the content-addressed store, hash-verified

114 ],
115)
116def test_lock_context_manager(lock_file: str, mode: Literal["read", "write"]) -> None:
117 lock = ReadWriteLock(lock_file, is_singleton=False)
118 with getattr(lock, f"{mode}_lock")():
119 assert (lock._hold.level, lock._hold.mode) == (1, mode)
120 assert lock._hold.level == 0
121 assert lock._hold.mode is None
122
123
124@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 1

ReadWriteLockClass · 0.90

Tested by

no test coverage detected