From bd7ce2c13cd60c77e1cd7b9f6db34139d42ce632 Mon Sep 17 00:00:00 2001 From: Yash Singh <123385188+yashs33244@users.noreply.github.com> Date: Fri, 19 Jun 2026 12:07:10 +0530 Subject: [PATCH] fix(vector_stores): drop stray print in Weaviate list_cols (#5637) --- mem0/vector_stores/weaviate.py | 1 - tests/vector_stores/test_weaviate.py | 10 ++++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/mem0/vector_stores/weaviate.py b/mem0/vector_stores/weaviate.py index 038528db6..c341b8a45 100644 --- a/mem0/vector_stores/weaviate.py +++ b/mem0/vector_stores/weaviate.py @@ -342,7 +342,6 @@ class Weaviate(VectorStoreBase): """ collections = self.client.collections.list_all() logger.debug(f"collections: {collections}") - print(f"collections: {collections}") return {"collections": [{"name": col.name} for col in collections]} def delete_col(self): diff --git a/tests/vector_stores/test_weaviate.py b/tests/vector_stores/test_weaviate.py index e7dcd3b6d..d246e08df 100644 --- a/tests/vector_stores/test_weaviate.py +++ b/tests/vector_stores/test_weaviate.py @@ -197,6 +197,16 @@ class TestWeaviateDB(unittest.TestCase): self.client_mock.collections.list_all.assert_called_once() + def test_list_cols_does_not_print(self): + mock_collection = MagicMock() + mock_collection.name = "collection1" + self.client_mock.collections.list_all.return_value = [mock_collection] + + with patch("builtins.print") as mock_print: + self.weaviate_db.list_cols() + + mock_print.assert_not_called() + def test_delete_col(self): self.weaviate_db.delete_col()