MCPcopy
hub / github.com/MinishLab/semble / test_index_cache_propagates_model_error

Function test_index_cache_propagates_model_error

tests/test_mcp.py:415–424  ·  view source on GitHub ↗

If model load fails, awaiting tool calls re-raise the original exception.

(tmp_path: Path)

Source from the content-addressed store, hash-verified

413
414@pytest.mark.anyio
415async 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

Callers

nothing calls this directly

Calls 2

_IndexCacheClass · 0.90
getMethod · 0.80

Tested by

no test coverage detected