From 147e4eeccce8281e6216233e57edf38c950a803d Mon Sep 17 00:00:00 2001 From: Dinesh Date: Thu, 17 Sep 2026 00:31:57 +0530 Subject: [PATCH] test: add missing assertions for run functions --- tests/test_runs/test_run_functions.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/test_runs/test_run_functions.py b/tests/test_runs/test_run_functions.py index 38128de30..dd536f435 100644 --- a/tests/test_runs/test_run_functions.py +++ b/tests/test_runs/test_run_functions.py @@ -224,7 +224,8 @@ def _assert_predictions_equal(self, predictions, predictions_prime): def _rerun_model_and_compare_predictions(self, run_id, model_prime, seed, create_task_obj): run = openml.runs.get_run(run_id) - # TODO: assert holdout task + task = openml.tasks.get_task(run.task_id) + assert "Holdout" in task.estimation_procedure["type"] # downloads the predictions of the old task file_id = run.output_files["predictions"] @@ -341,12 +342,12 @@ def _remove_random_state(flow): assert isinstance(run.dataset_id, int) # This is only a smoke check right now - # TODO add a few asserts here + assert len(run.parameter_settings) > 0 run._to_xml() if run.trace is not None: # This is only a smoke check right now - # TODO add a few asserts here - run.trace.trace_to_arff() + trace_arff = run.trace.trace_to_arff() + assert len(trace_arff["data"]) > 0 # check arff output assert len(run.data_content) == num_instances @@ -609,7 +610,7 @@ def determine_grid_size(param_grid): create_task_obj=False, ) - # todo: check if runtime is present + assert "usercpu_time_millis" in run.fold_evaluations self._check_fold_timing_evaluations( fold_evaluations=run.fold_evaluations, num_repeats=1,