File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -198,16 +198,20 @@ def mock_ragas_dependencies_not_present():
198
198
@pytest .fixture
199
199
def ragas (mock_llmobs_span_writer , mock_llmobs_eval_metric_writer ):
200
200
with override_global_config (dict (_dd_api_key = "<not-a-real-key>" )):
201
- import ragas
202
-
201
+ try :
202
+ import ragas
203
+ except ImportError :
204
+ pytest .skip ("Ragas not installed" )
203
205
with override_env (dict (OPENAI_API_KEY = os .getenv ("OPENAI_API_KEY" , "<not-a-real-key>" ))):
204
206
yield ragas
205
207
206
208
207
209
@pytest .fixture
208
210
def reset_ragas_faithfulness_llm ():
209
- import ragas
210
-
211
+ try :
212
+ import ragas
213
+ except ImportError :
214
+ pytest .skip ("Ragas not installed" )
211
215
previous_llm = ragas .metrics .faithfulness .llm
212
216
yield
213
217
ragas .metrics .faithfulness .llm = previous_llm
You can’t perform that action at this time.
0 commit comments