What this thread does
Do first: Use from deepeval.dataset import EvaluationDataset.
When you need it
Use this when goldens for a CI evaluation live in a CSV. The page loads them into EvaluationDataset, then constructs tests and runs the test file through DeepEval's pytest integration.
Steps
1. In test_llm_app.py, load the page's CSV example and map its query column:
from deepeval.dataset import EvaluationDataset
dataset = EvaluationDataset()
dataset.add_goldens_from_csv_file(
file_path="example.csv",
input_col_name="query",
)
2. To follow the page's single-turn manual-instrumentation example, add its imports and agent scaffold. Replace the scaffold with your application when adopting the example:
import pytest
from deepeval import assert_test
from deepeval.dataset import Golden
from deepeval.metrics import TaskCompletionMetric
from deepeval.tracing import observe, update_current_trace
@observe()
def my_ai_agent(query: str) -> str:
answer = "Pi rounded to 2 decimal places is 3.14."
update_current_trace(input=query, output=answer)
return answer
3. Parametrize the test over the loaded goldens, as the page does:
@pytest.mark.parametrize("golden", dataset.goldens)
def test_llm_app(golden: Golden):
my_ai_agent(golden.input)
assert_test(golden=golden, metrics=[TaskCompletionMetric()])
4. Run the documented test-file command in your CI shell step:
deepeval test run test_llm_app.py
Check it worked
The page says a metric below its threshold fails the assertion and makes the build go red. This is the gate supplied by assert_test() in the test runner.
Limits
An EvaluationDataset holds either single-turn or multi-turn goldens; a file mixing them raises an error. The agent above is the page's fixed-answer teaching scaffold. The page displays Python v4.3.5 but gives no introduction version for the CSV method. OPENAI_API_KEY is the page's example judge environment variable; a Confident AI account is optional.
Not for: choosing binary G-Eval scoring with strict_mode.
Sources
- Unit Testing in CI/CD, DeepEval documentation, read 2026-11-24: "A file that mixes the two raises an error."
Checked
2026-11-24; read <https://deepeval.com/docs/evaluation-unit-testing-in-ci-cd>; no command was run.
Started from a post by @Confident AI Inc., packaged by the editor. Original post