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

Function test_nested_write_context_managers

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

Source from the content-addressed store, hash-verified

278
279
280def test_nested_write_context_managers(lock_file: str) -> None:
281 lock = ReadWriteLock(lock_file, is_singleton=False)
282 with lock.write_lock():
283 assert lock._hold.level == 1
284 with lock.write_lock():
285 assert lock._hold.level == 2
286 assert lock._hold.level == 1
287 assert lock._hold.level == 0
288
289
290@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 2

write_lockMethod · 0.95
ReadWriteLockClass · 0.90

Tested by

no test coverage detected