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

Function test_nested_forced_release

tests/test_filelock.py:188–201  ·  view source on GitHub ↗
(lock_type: type[BaseFileLock], tmp_path: Path)

Source from the content-addressed store, hash-verified

186
187@pytest.mark.parametrize("lock_type", [FileLock, SoftFileLock])
188def test_nested_forced_release(lock_type: type[BaseFileLock], tmp_path: Path) -> None:
189 # acquires the lock using a with-statement and releases the lock before leaving the with-statement
190 lock_path = tmp_path / "a"
191 lock = lock_type(str(lock_path))
192
193 with lock:
194 assert lock.is_locked
195
196 lock.acquire()
197 assert lock.is_locked
198
199 lock.release(force=True)
200 assert not lock.is_locked
201 assert not lock.is_locked
202
203
204@pytest.mark.parametrize("lock_type", [FileLock, SoftFileLock])

Callers

nothing calls this directly

Calls 2

acquireMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected