From 15d9ee1b5164edd17bbead251c1620f290062064 Mon Sep 17 00:00:00 2001 From: "7. Sun" Date: Sun, 12 Apr 2026 07:14:23 +0100 Subject: [PATCH] fix: close KnowledgeGraph SQLite connections in test fixtures (#450) Co-authored-by: Claude Opus 4.6 --- tests/conftest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 7a3e55a..16185ef 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -169,7 +169,9 @@ def seeded_collection(collection): def kg(tmp_dir): """An isolated KnowledgeGraph using a temp SQLite file.""" db_path = os.path.join(tmp_dir, "test_kg.sqlite3") - return KnowledgeGraph(db_path=db_path) + graph = KnowledgeGraph(db_path=db_path) + yield graph + graph.close() @pytest.fixture