Skip to content

Commit

Permalink
Tests: fix skip tests (#60)
Browse files Browse the repository at this point in the history
* Tests: fix skip tests

* fix action

* lint
  • Loading branch information
lusmoura authored Apr 26, 2024
1 parent baf1102 commit 06aa3d2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/backend/tests/routers/test_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
5 changes: 4 additions & 1 deletion src/backend/tests/tools/retrieval/test_collate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
5 changes: 4 additions & 1 deletion src/backend/tests/tools/retrieval/test_lang_chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 06aa3d2

Please sign in to comment.