(lock_file: str, mode: Literal["read", "write"])
| 198 | @pytest.mark.parametrize("mode", [pytest.param("read", id="read"), pytest.param("write", id="write")]) |
| 199 | @pytest.mark.asyncio |
| 200 | async def test_nested_context_managers(lock_file: str, mode: Literal["read", "write"]) -> None: |
| 201 | lock = AsyncReadWriteLock(lock_file, is_singleton=False) |
| 202 | make_ctx = getattr(lock, f"{mode}_lock") |
| 203 | async with make_ctx(): |
| 204 | assert_mode_held(lock_file, mode) |
| 205 | async with make_ctx(): |
| 206 | assert_mode_held(lock_file, mode) |
| 207 | assert_mode_held(lock_file, mode) |
| 208 | with pytest.raises(RuntimeError, match="not held"): |
| 209 | await lock.release() |
| 210 | await lock.close() |
| 211 | |
| 212 | |
| 213 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected