You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor evaluation_test to improve error handling and metadata initialization. Ensure eval_metadata is set for each row before rollouts, and enhance exception management to log errors appropriately while maintaining pytest behavior.
f"Test function {test_func.__name__} did not return an EvaluationRow instance. You must return an EvaluationRow instance from your test function decorated with @evaluation_test."
269
+
)
270
+
all_results.append(result)
271
+
else:
272
+
# Batch mode: call the test function with the full dataset
273
+
results=execute_with_params(
259
274
test_func,
260
-
row=row,
275
+
input_dataset=input_dataset,
261
276
evaluation_test_kwargs=kwargs.get("evaluation_test_kwargs") or {},
f"Test function {test_func.__name__} did not return an EvaluationRow instance. You must return an EvaluationRow instance from your test function decorated with @evaluation_test."
266
281
)
267
-
all_results.append(result)
268
-
else:
269
-
# Batch mode: call the test function with the full dataset
270
-
results=execute_with_params(
271
-
test_func,
272
-
input_dataset=input_dataset,
273
-
evaluation_test_kwargs=kwargs.get("evaluation_test_kwargs") or {},
274
-
)
275
-
ifresultsisNone:
276
-
raiseValueError(
277
-
f"Test function {test_func.__name__} did not return an EvaluationRow instance. You must return an EvaluationRow instance from your test function decorated with @evaluation_test."
278
-
)
279
-
ifnotisinstance(results, list):
280
-
raiseValueError(
281
-
f"Test function {test_func.__name__} did not return a list of EvaluationRow instances. You must return a list of EvaluationRow instances from your test function decorated with @evaluation_test."
282
-
)
283
-
ifnotresults:
284
-
raiseValueError(
285
-
f"Test function {test_func.__name__} returned an empty list. You must return a non-empty list of EvaluationRow instances from your test function decorated with @evaluation_test."
f"Test function {test_func.__name__} returned a list containing non-EvaluationRow instances. You must return a list of EvaluationRow instances from your test function decorated with @evaluation_test."
f"Test function {test_func.__name__} did not return a list of EvaluationRow instances. You must return a list of EvaluationRow instances from your test function decorated with @evaluation_test."
285
+
)
286
+
ifnotresults:
287
+
raiseValueError(
288
+
f"Test function {test_func.__name__} returned an empty list. You must return a non-empty list of EvaluationRow instances from your test function decorated with @evaluation_test."
f"Test function {test_func.__name__} returned a list containing non-EvaluationRow instances. You must return a list of EvaluationRow instances from your test function decorated with @evaluation_test."
0 commit comments