(tmp_path: Path)
| 177 | |
| 178 | @pytest.mark.asyncio |
| 179 | async def test_coroutine_function(tmp_path: Path) -> None: |
| 180 | acquired = released = False |
| 181 | |
| 182 | class AioFileLock(BaseAsyncFileLock): |
| 183 | async def _acquire(self) -> None: # ty: ignore[invalid-method-override] |
| 184 | nonlocal acquired |
| 185 | acquired = True |
| 186 | self._context.lock_file_fd = 1 |
| 187 | |
| 188 | async def _release(self) -> None: # ty: ignore[invalid-method-override] |
| 189 | nonlocal released |
| 190 | released = True |
| 191 | self._context.lock_file_fd = None |
| 192 | |
| 193 | lock = AioFileLock(str(tmp_path / "a")) |
| 194 | await lock.acquire() |
| 195 | assert acquired |
| 196 | assert not released |
| 197 | await lock.release() |
| 198 | assert acquired |
| 199 | assert released |
| 200 | |
| 201 | |
| 202 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected