mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-20 05:18:16 +00:00
Update memory tests to handle optional ChromaDB dependency
Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
@@ -7,10 +7,28 @@ from crewai.memory.long_term.long_term_memory_item import LongTermMemoryItem
|
||||
@pytest.fixture
|
||||
def long_term_memory():
|
||||
"""Fixture to create a LongTermMemory instance"""
|
||||
try:
|
||||
import chromadb
|
||||
HAS_CHROMADB = True
|
||||
except ImportError:
|
||||
HAS_CHROMADB = False
|
||||
|
||||
if not HAS_CHROMADB:
|
||||
pytest.skip("ChromaDB is required for this test")
|
||||
|
||||
return LongTermMemory()
|
||||
|
||||
|
||||
def test_save_and_search(long_term_memory):
|
||||
try:
|
||||
import chromadb
|
||||
HAS_CHROMADB = True
|
||||
except ImportError:
|
||||
HAS_CHROMADB = False
|
||||
|
||||
if not HAS_CHROMADB:
|
||||
pytest.skip("ChromaDB is required for this test")
|
||||
|
||||
memory = LongTermMemoryItem(
|
||||
agent="test_agent",
|
||||
task="test_task",
|
||||
|
||||
Reference in New Issue
Block a user