From f2c9c5581cd5fcb60864db244eaa1a7c140a6973 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 10:22:18 +0000 Subject: [PATCH] Fix: Update tests to work with lazy ChromaDB imports Co-Authored-By: Joe Moura --- tests/utilities/test_knowledge_planning.py | 2 +- tests/utilities/test_planning_handler.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/utilities/test_knowledge_planning.py b/tests/utilities/test_knowledge_planning.py index 37b6df69f..344d9dfc5 100644 --- a/tests/utilities/test_knowledge_planning.py +++ b/tests/utilities/test_knowledge_planning.py @@ -29,7 +29,7 @@ def mock_knowledge_source(): """ return StringKnowledgeSource(content=content) -@patch('crewai.knowledge.storage.knowledge_storage.chromadb') +@patch('chromadb.PersistentClient') def test_knowledge_included_in_planning(mock_chroma): """Test that verifies knowledge sources are properly included in planning.""" # Mock ChromaDB collection diff --git a/tests/utilities/test_planning_handler.py b/tests/utilities/test_planning_handler.py index e1c27c341..1d1ceefed 100644 --- a/tests/utilities/test_planning_handler.py +++ b/tests/utilities/test_planning_handler.py @@ -100,7 +100,7 @@ class InternalCrewPlanner: # Knowledge field should not be present when empty assert '"agent_knowledge"' not in tasks_summary - @patch('crewai.knowledge.storage.knowledge_storage.chromadb') + @patch('chromadb.PersistentClient') def test_create_tasks_summary_with_knowledge_and_tools(self, mock_chroma): """Test task summary generation with both knowledge and tools present.""" # Mock ChromaDB collection