Files
crewAI/tests/rag/config/test_optional_imports.py
Greyson LaLonde 7ac482c7c9
Some checks failed
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
feat: rag configuration with optional dependency support (#3394)
### RAG Config System

* Added ChromaDB client creation via config with sensible defaults
* Introduced optional imports and shared RAG config utilities/schema
* Enabled embedding function support with ChromaDB provider integration
* Refactored configs for immutability and stronger type safety
* Removed unused code and expanded test coverage
2025-08-26 00:00:22 -04:00

23 lines
744 B
Python

"""Tests for optional imports."""
import pytest
from crewai.rag.config.optional_imports.base import _MissingProvider
from crewai.rag.config.optional_imports.providers import MissingChromaDBConfig
def test_missing_provider_raises_runtime_error():
"""Test that _MissingProvider raises RuntimeError on instantiation."""
with pytest.raises(
RuntimeError, match="provider '__missing__' requested but not installed"
):
_MissingProvider()
def test_missing_chromadb_config_raises_runtime_error():
"""Test that MissingChromaDBConfig raises RuntimeError on instantiation."""
with pytest.raises(
RuntimeError, match="provider 'chromadb' requested but not installed"
):
MissingChromaDBConfig()