Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: fix skip tests #60

Merged
merged 3 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading