Skip to content

Commit

Permalink
Skip all ragas tests if ragas unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
Yun-Kim committed Jan 6, 2025
1 parent 34f469d commit b20211e
Show file tree
Hide file tree
Showing 8 changed files with 204 additions and 209 deletions.
6 changes: 1 addition & 5 deletions riotfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2885,11 +2885,7 @@ def select_pys(min_version: str = MIN_PYTHON_VERSION, max_version: str = MAX_PYT
pkgs={"vcrpy": latest, "pytest-asyncio": "==0.21.1"},
venvs=[
Venv(pys="3.7"),
Venv(
pys=select_pys(min_version="3.8"),
pkgs={"ragas": "==0.1.21", "langchain": latest},
env={"RAGAS_AVAILABLE": "True"},
),
Venv(pys=select_pys(min_version="3.8"), pkgs={"ragas": "==0.1.21", "langchain": latest}),
],
),
Venv(
Expand Down
405 changes: 202 additions & 203 deletions tests/llmobs/test_llmobs_ragas_faithfulness_evaluator.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/llmobs/test_llmobs_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1746,8 +1746,8 @@ async def test_annotation_context_async_nested(llmobs):
assert span._get_ctx_item(TAGS) == {"foo": "baz", "boo": "bar"}


@pytest.mark.skipif(not RAGAS_AVAILABLE, reason="Test requires ragas to be available on user env")
def test_service_enable_starts_evaluator_runner_when_evaluators_exist():
pytest.importorskip("ragas")
with override_global_config(dict(_dd_api_key="<not-a-real-api-key>", _llmobs_ml_app="<ml-app-name>")):
with override_env(dict(_DD_LLMOBS_EVALUATORS="ragas_faithfulness")):
dummy_tracer = DummyTracer()
Expand Down

0 comments on commit b20211e

Please sign in to comment.