mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-12-24 05:28:42 +00:00
test: monkeypatch some env vars in Predefined Pipelines tests (#7321)
* ci: skip some tests if the OPENAI API key is not set * better idea: monkeypatch the env var
This commit is contained in:
parent
ede768a517
commit
3dbde84a28
@ -700,7 +700,8 @@ def test_describe_no_outputs():
|
||||
assert p.outputs() == {}
|
||||
|
||||
|
||||
def test_from_template():
|
||||
def test_from_template(monkeypatch):
|
||||
monkeypatch.setenv("OPENAI_API_KEY", "fake_key")
|
||||
pipe = Pipeline.from_template(PredefinedPipeline.INDEXING)
|
||||
assert pipe.get_component("cleaner")
|
||||
|
||||
|
||||
@ -44,7 +44,8 @@ class TestPipelineTemplate:
|
||||
assert len(tpl.template_content)
|
||||
|
||||
# Building a pipeline directly using all default components specified in a predefined or custom template.
|
||||
def test_build_pipeline_with_default_components(self):
|
||||
def test_build_pipeline_with_default_components(self, monkeypatch):
|
||||
monkeypatch.setenv("OPENAI_API_KEY", "fake_key")
|
||||
rendered = PipelineTemplate.from_predefined(PredefinedPipeline.INDEXING).render()
|
||||
pipeline = Pipeline.loads(rendered)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user