diff --git a/src/backend/tests/routers/test_chat.py b/src/backend/tests/routers/test_chat.py index 573d83dc86..238dd13e30 100644 --- a/src/backend/tests/routers/test_chat.py +++ b/src/backend/tests/routers/test_chat.py @@ -15,7 +15,10 @@ from backend.schemas.tool import Category from backend.tests.factories import get_factory -is_cohere_env_set = os.environ.get("COHERE_API_KEY") is not None +is_cohere_env_set = ( + os.environ.get("COHERE_API_KEY") is not None + and os.environ.get("COHERE_API_KEY") != "" +) @pytest.fixture() diff --git a/src/backend/tests/tools/retrieval/test_collate.py b/src/backend/tests/tools/retrieval/test_collate.py index 776cfe174e..f0117ac08a 100644 --- a/src/backend/tests/tools/retrieval/test_collate.py +++ b/src/backend/tests/tools/retrieval/test_collate.py @@ -5,7 +5,10 @@ from backend.chat.custom.model_deployments.cohere_platform import CohereDeployment from backend.tools.retrieval import collate -is_cohere_env_set = os.environ.get("COHERE_API_KEY") is not None +is_cohere_env_set = ( + os.environ.get("COHERE_API_KEY") is not None + and os.environ.get("COHERE_API_KEY") != "" +) @pytest.mark.skipif(not is_cohere_env_set, reason="Cohere API key not set") diff --git a/src/backend/tests/tools/retrieval/test_lang_chain.py b/src/backend/tests/tools/retrieval/test_lang_chain.py index f5fbe90476..1f3dc93952 100644 --- a/src/backend/tests/tools/retrieval/test_lang_chain.py +++ b/src/backend/tests/tools/retrieval/test_lang_chain.py @@ -9,7 +9,10 @@ LangChainWikiRetriever, ) -is_cohere_env_set = os.environ.get("COHERE_API_KEY") is not None +is_cohere_env_set = ( + os.environ.get("COHERE_API_KEY") is not None + and os.environ.get("COHERE_API_KEY") != "" +) def test_wiki_retriever() -> None: