(tmp_path: Path)
| 159 | |
| 160 | @pytest.mark.asyncio |
| 161 | async def test_coroutine_function(tmp_path: Path) -> None: |
| 162 | acquired = released = False |
| 163 | |
| 164 | class AioFileLock(BaseAsyncFileLock): |
| 165 | async def _acquire(self) -> None: # type: ignore[override] |
| 166 | nonlocal acquired |
| 167 | acquired = True |
| 168 | self._context.lock_file_fd = 1 |
| 169 | |
| 170 | async def _release(self) -> None: # type: ignore[override] |
| 171 | nonlocal released |
| 172 | released = True |
| 173 | self._context.lock_file_fd = None |
| 174 | |
| 175 | lock = AioFileLock(str(tmp_path / "a")) |
| 176 | await lock.acquire() |
| 177 | assert acquired |
| 178 | assert not released |
| 179 | await lock.release() |
| 180 | assert acquired |
| 181 | assert released |
nothing calls this directly
no test coverage detected