| 186 | fail_release = True |
| 187 | |
| 188 | class GroupReleaseLock(BaseAsyncFileLock): |
| 189 | def _acquire(self) -> None: |
| 190 | self._context.lock_file_fd = 1 |
| 191 | |
| 192 | def _release(self) -> None: |
| 193 | nonlocal fail_release |
| 194 | if fail_release: |
| 195 | fail_release = False |
| 196 | raise release_group |
| 197 | self._context.lock_file_fd = None |
| 198 | |
| 199 | lock = GroupReleaseLock(tmp_path / "a", run_in_executor=False, context_error_policy="group") |
| 200 | with pytest.raises(BaseExceptionGroup) as info: |
no outgoing calls