| 186 | |
| 187 | @pytest.mark.parametrize("lock_type", [FileLock, SoftFileLock]) |
| 188 | def 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]) |