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

Function test_single_lock_reentrant

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

Source from the content-addressed store, hash-verified

246)
247@pytest.mark.timeout(15)
248def test_single_lock_reentrant(lock_file: str, mode: Literal["read", "write"]) -> None:
249 acquire = getattr(ReadWriteLock(lock_file), f"{mode}_lock")
250
251 with acquire():
252 with acquire():
253 pass
254 assert not writer_gets_in(lock_file)
255
256 assert writer_gets_in(lock_file)
257
258
259@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

ReadWriteLockClass · 0.90
writer_gets_inFunction · 0.90
acquireFunction · 0.50

Tested by

no test coverage detected