(lock_file: str, mode: Literal["read", "write"])
| 37 | @pytest.mark.parametrize("mode", [pytest.param("read", id="read"), pytest.param("write", id="write")]) |
| 38 | @pytest.mark.asyncio |
| 39 | async def test_acquire_release(lock_file: str, mode: Literal["read", "write"]) -> None: |
| 40 | lock = AsyncReadWriteLock(lock_file, is_singleton=False) |
| 41 | proxy = await (lock.acquire_read() if mode == "read" else lock.acquire_write()) |
| 42 | async with proxy as held: |
| 43 | assert held is lock |
| 44 | with pytest.raises(RuntimeError, match="not held"): |
| 45 | await lock.release() |
| 46 | await lock.close() |
| 47 | |
| 48 | |
| 49 | @pytest.mark.parametrize("mode", [pytest.param("read", id="read"), pytest.param("write", id="write")]) |
nothing calls this directly
no test coverage detected