mirror of
https://github.com/deepset-ai/haystack.git
synced 2026-01-07 20:46:31 +00:00
Fix skipif with empty env var (#6704)
This commit is contained in:
parent
607e7d1488
commit
9445b2d466
@ -164,7 +164,7 @@ class TestOpenAIDocumentEmbedder:
|
||||
assert result["documents"] is not None
|
||||
assert not result["documents"] # empty list
|
||||
|
||||
@pytest.mark.skipif("OPENAI_API_KEY" not in os.environ, reason="OPENAI_API_KEY is not set")
|
||||
@pytest.mark.skipif(os.environ.get("OPENAI_API_KEY", "") == "", reason="OPENAI_API_KEY is not set")
|
||||
@pytest.mark.integration
|
||||
def test_run(self):
|
||||
docs = [
|
||||
|
||||
@ -76,7 +76,7 @@ class TestOpenAITextEmbedder:
|
||||
with pytest.raises(TypeError, match="OpenAITextEmbedder expects a string as an input"):
|
||||
embedder.run(text=list_integers_input)
|
||||
|
||||
@pytest.mark.skipif("OPENAI_API_KEY" not in os.environ, reason="OPENAI_API_KEY is not set")
|
||||
@pytest.mark.skipif(os.environ.get("OPENAI_API_KEY", "") == "", reason="OPENAI_API_KEY is not set")
|
||||
@pytest.mark.integration
|
||||
def test_run(self):
|
||||
model = "text-similarity-ada-001"
|
||||
|
||||
@ -67,7 +67,7 @@ class TestIndexingPipeline:
|
||||
with pytest.raises(ValueError, match="Could not find an embedder"):
|
||||
build_indexing_pipeline(document_store=document_store, embedding_model="invalid_model")
|
||||
|
||||
@pytest.mark.skipif("OPENAI_API_KEY" not in os.environ, reason="OPENAI_API_KEY is not set")
|
||||
@pytest.mark.skipif(os.environ.get("OPENAI_API_KEY", "") == "", reason="OPENAI_API_KEY is not set")
|
||||
@pytest.mark.integration
|
||||
def test_open_ai_embedding_model(self):
|
||||
document_store = InMemoryDocumentStore()
|
||||
|
||||
@ -8,7 +8,7 @@ from haystack.pipeline_utils.rag import build_rag_pipeline
|
||||
from haystack.testing.factory import document_store_class
|
||||
|
||||
|
||||
@pytest.mark.skipif("OPENAI_API_KEY" not in os.environ, reason="OPENAI_API_KEY is not set")
|
||||
@pytest.mark.skipif(os.environ.get("OPENAI_API_KEY", "") == "", reason="OPENAI_API_KEY is not set")
|
||||
@pytest.mark.integration
|
||||
def test_rag_pipeline(mock_chat_completion):
|
||||
rag_pipe = build_rag_pipeline(document_store=InMemoryDocumentStore())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user