(lock_file: str, mode: Literal["read", "write"])
| 77 | @pytest.mark.parametrize("mode", [pytest.param("read", id="read"), pytest.param("write", id="write")]) |
| 78 | @pytest.mark.asyncio |
| 79 | async def test_lock_context_manager(lock_file: str, mode: Literal["read", "write"]) -> None: |
| 80 | lock = AsyncReadWriteLock(lock_file, is_singleton=False) |
| 81 | async with getattr(lock, f"{mode}_lock")(): |
| 82 | assert_mode_held(lock_file, mode) |
| 83 | with pytest.raises(RuntimeError, match="not held"): |
| 84 | await lock.release() |
| 85 | await lock.close() |
| 86 | |
| 87 | |
| 88 | @pytest.mark.parametrize("mode", [pytest.param("read", id="read"), pytest.param("write", id="write")]) |
nothing calls this directly
no test coverage detected