If model load fails, awaiting tool calls re-raise the original exception.
(tmp_path: Path)
| 413 | |
| 414 | @pytest.mark.anyio |
| 415 | async def test_index_cache_propagates_model_error(tmp_path: Path) -> None: |
| 416 | """If model load fails, awaiting tool calls re-raise the original exception.""" |
| 417 | cache = _IndexCache() |
| 418 | get_task = asyncio.create_task(cache.get(str(tmp_path))) |
| 419 | await asyncio.sleep(0.01) |
| 420 | assert not get_task.done() |
| 421 | cache._model_error = RuntimeError("HF download failed") |
| 422 | cache._model_ready.set() |
| 423 | with pytest.raises(RuntimeError, match="HF download failed"): |
| 424 | await asyncio.wait_for(get_task, timeout=1.0) |
| 425 | |
| 426 | |
| 427 | @pytest.mark.anyio |
nothing calls this directly
no test coverage detected