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

Function test_nested_read_context_managers

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

Source from the content-addressed store, hash-verified

265
266
267def test_nested_read_context_managers(lock_file: str) -> None:
268 lock = ReadWriteLock(lock_file, is_singleton=False)
269 with lock.read_lock():
270 assert lock._hold.level == 1
271 with lock.read_lock():
272 assert lock._hold.level == 2
273 with lock.read_lock():
274 assert lock._hold.level == 3
275 assert lock._hold.level == 2
276 assert lock._hold.level == 1
277 assert lock._hold.level == 0
278
279
280def test_nested_write_context_managers(lock_file: str) -> None:

Callers

nothing calls this directly

Calls 2

read_lockMethod · 0.95
ReadWriteLockClass · 0.90

Tested by

no test coverage detected