fix coverage

This commit is contained in:
bryan davis 2026-07-08 18:50:24 -05:00
parent d8ea016119
commit f72d0c833f
No known key found for this signature in database
GPG key ID: D11B4A4C0C731E5E

View file

@ -154,6 +154,21 @@ async def test_client_embedder_is_store_embedder(temp_db_path):
assert client.embedder is client.store.embedder
async def test_client_aexit_swallows_embedder_aclose_error(temp_db_path, monkeypatch):
"""A failure while closing the embedder's pooled client on teardown is
best-effort: __aexit__ swallows it so it can't mask an unwinding exception
or break a normal exit."""
from haiku.rag.client import HaikuRAG
async def _boom():
raise RuntimeError("aclose failed")
async with HaikuRAG(temp_db_path, create=True) as client:
monkeypatch.setattr(client.embedder, "aclose", _boom)
# Reaching here means the context manager exited without propagating the
# RuntimeError raised by aclose().
@pytest.mark.vcr()
async def test_embed_chunks_basic(allow_model_requests):
"""Test that embed_chunks generates embeddings for chunks."""