Fix CI failures: restore missing error classes and resolve type issues

Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
Devin AI
2025-05-30 09:19:30 +00:00
parent c7e83a7529
commit ebcb6c6f90
3 changed files with 64 additions and 16 deletions

View File

@@ -3,6 +3,8 @@ import importlib
import sys
from unittest.mock import patch
from crewai.utilities.errors import ChromaDBRequiredError
def test_import_without_chromadb():
"""Test that crewai can be imported without chromadb."""
@@ -31,7 +33,7 @@ def test_memory_storage_without_chromadb():
assert not HAS_CHROMADB
with pytest.raises(ImportError) as excinfo:
with pytest.raises(ChromaDBRequiredError) as excinfo:
storage = RAGStorage()
storage._initialize_app()
@@ -48,7 +50,7 @@ def test_knowledge_storage_without_chromadb():
assert not HAS_CHROMADB
with pytest.raises(ImportError) as excinfo:
with pytest.raises(ChromaDBRequiredError) as excinfo:
storage = KnowledgeStorage()
storage.initialize_knowledge_storage()
@@ -65,7 +67,7 @@ def test_embedding_configurator_without_chromadb():
assert not HAS_CHROMADB
with pytest.raises(ImportError) as excinfo:
with pytest.raises(ChromaDBRequiredError) as excinfo:
configurator = EmbeddingConfigurator()
configurator.configure_embedder()