(lock_file: str, mode: Literal["read", "write"])
| 88 | @pytest.mark.parametrize("mode", [pytest.param("read", id="read"), pytest.param("write", id="write")]) |
| 89 | @pytest.mark.asyncio |
| 90 | async def test_reentrant(lock_file: str, mode: Literal["read", "write"]) -> None: |
| 91 | lock = AsyncReadWriteLock(lock_file, is_singleton=False) |
| 92 | acquire = getattr(lock, f"acquire_{mode}") |
| 93 | await acquire() |
| 94 | await acquire() |
| 95 | await lock.release() |
| 96 | assert_mode_held(lock_file, mode) |
| 97 | await lock.release() |
| 98 | with pytest.raises(RuntimeError, match="not held"): |
| 99 | await lock.release() |
| 100 | await lock.close() |
| 101 | |
| 102 | |
| 103 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected