(lock_file: str, mode: Literal["read", "write"])
| 49 | @pytest.mark.parametrize("mode", [pytest.param("read", id="read"), pytest.param("write", id="write")]) |
| 50 | @pytest.mark.asyncio |
| 51 | async def test_lock_context_manager(lock_file: str, mode: Literal["read", "write"]) -> None: |
| 52 | lock = AsyncReadWriteLock(lock_file, is_singleton=False) |
| 53 | ctx = lock.read_lock() if mode == "read" else lock.write_lock() |
| 54 | async with ctx: |
| 55 | assert_mode_held(lock_file, mode) |
| 56 | with pytest.raises(RuntimeError, match="not held"): |
| 57 | await lock.release() |
| 58 | await lock.close() |
| 59 | |
| 60 | |
| 61 | @pytest.mark.parametrize("mode", [pytest.param("read", id="read"), pytest.param("write", id="write")]) |
nothing calls this directly
no test coverage detected