Fix lint issues: suppress unused chromadb import warnings and update remaining external memory test

Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
Devin AI
2025-05-30 09:45:39 +00:00
parent 5566f4716b
commit 6b354201cb
4 changed files with 20 additions and 11 deletions

View File

@@ -170,7 +170,7 @@ def test_crew_external_memory_save_with_memory_flag(
mem_method, crew_with_external_memory
):
try:
import chromadb
import chromadb # noqa: F401
HAS_CHROMADB = True
except ImportError:
HAS_CHROMADB = False
@@ -190,6 +190,15 @@ def test_crew_external_memory_save_with_memory_flag(
def test_crew_external_memory_save_using_crew_without_memory_flag(
mem_method, crew_with_external_memory_without_memory_flag
):
try:
import chromadb # noqa: F401
HAS_CHROMADB = True
except ImportError:
HAS_CHROMADB = False
if not HAS_CHROMADB:
pytest.skip("ChromaDB is required for this test")
with patch(
f"crewai.memory.external.external_memory.ExternalMemory.{mem_method}"
) as mock_method: