test(agents): give the graph tool tests the vector store they need

The tool now asks graphrag_available(), which wants pgvector as well as the
flag. One case set only the flag and passed locally off a dev .env, then
failed on CI's faiss default. An autouse fixture sets it for the module, so a
case that forgets fails for its own reason; the two about a different vector
store override it themselves.
This commit is contained in:
Alex committed 2026-09-20 10:54:55 +01:00
1 parent ef5b718f37
commit 692edcdd4e
1 file changed
+11
+11
View File
@@ -22,6 +22,17 @@ from docsgpt.core.settings import settings
SOURCE = {"active_docs": ["src-1"]}
@pytest.fixture(autouse=True)
def _graph_store_is_pgvector(monkeypatch):
"""The graph only exists under pgvector, and CI's default is faiss.
Set here rather than per test so a case that forgets it fails for its own
reason instead of the gate; the cases about a different vector store
override it in the test body.
"""
monkeypatch.setattr(settings, "VECTOR_STORE", "pgvector")
class _StubStore:
def __init__(self, nodes=None, relationships=None, pages=None):
self._nodes = nodes or []