From 3469cad29220d19553e6a9645b54ba6848d93329 Mon Sep 17 00:00:00 2001 From: Atharva Date: Tue, 29 Sep 2026 23:34:29 +0530 Subject: [PATCH 1/3] Test: assert houldout task, task.estimation procedure type --- tests/test_runs/test_run_functions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_runs/test_run_functions.py b/tests/test_runs/test_run_functions.py index 38128de30..316460b4f 100644 --- a/tests/test_runs/test_run_functions.py +++ b/tests/test_runs/test_run_functions.py @@ -224,7 +224,9 @@ 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 + # assert for holdout task + task = openml.tasks.get_task(run.task_id) + assert task.estimation_procedure["type"] == "holdout" # downloads the predictions of the old task file_id = run.output_files["predictions"] From 0a00381bb24dfc739af89e2689c2332cdb3fd317 Mon Sep 17 00:00:00 2001 From: Atharva Date: Tue, 29 Sep 2026 23:46:27 +0530 Subject: [PATCH 2/3] test: run.race_iterations and run asserts --- tests/test_runs/test_run_functions.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_runs/test_run_functions.py b/tests/test_runs/test_run_functions.py index 316460b4f..02c7a8079 100644 --- a/tests/test_runs/test_run_functions.py +++ b/tests/test_runs/test_run_functions.py @@ -345,10 +345,18 @@ def _remove_random_state(flow): # This is only a smoke check right now # TODO add a few asserts here run._to_xml() + assert isinstance(run._to_xml(), str) + if run.trace is not None: # This is only a smoke check right now # TODO add a few asserts here + assert run.trace.run_id == run.run_id + assert run.trace.trace_iterations is not None + for trace_iteration in run.trace.trace_iterations.values(): + assert (trace_iteration.setup_string is not None) != (trace_iteration.setup_string is not None) + run.trace.trace_to_arff() + assert isinstance(run.trace, dict) # check arff output assert len(run.data_content) == num_instances From 8d50354cf8017d55a2829d98eefaf53ffde92062 Mon Sep 17 00:00:00 2001 From: Atharva Date: Wed, 30 Sep 2026 13:07:31 +0530 Subject: [PATCH 3/3] test: run_trace and downloaded_run_trace comparison todo --- tests/test_runs/test_run_functions.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/test_runs/test_run_functions.py b/tests/test_runs/test_run_functions.py index 02c7a8079..68146b16c 100644 --- a/tests/test_runs/test_run_functions.py +++ b/tests/test_runs/test_run_functions.py @@ -343,17 +343,15 @@ 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 run._to_xml() assert isinstance(run._to_xml(), str) if run.trace is not None: # This is only a smoke check right now - # TODO add a few asserts here assert run.trace.run_id == run.run_id assert run.trace.trace_iterations is not None for trace_iteration in run.trace.trace_iterations.values(): - assert (trace_iteration.setup_string is not None) != (trace_iteration.setup_string is not None) + assert (trace_iteration.setup_string is not None) != (trace_iteration.parameters is not None) run.trace.trace_to_arff() assert isinstance(run.trace, dict) @@ -404,13 +402,18 @@ def _remove_random_state(flow): downloaded = openml.runs.get_run(run_.run_id) assert "openml-python" in downloaded.tags - # TODO make sure that these attributes are instantiated when # downloading a run? Or make sure that the trace object is created when # running a flow on a task (and not only the arff object is created, # so that the two objects can actually be compared): # downloaded_run_trace = downloaded._generate_trace_arff_dict() # self.assertEqual(run_trace, downloaded_run_trace) + + downloaded_run_trace = downloaded.trace + assert downloaded_run_trace is not None + assert run.trace is not None + self.assertEqual(run.trace, downloaded_run_trace) + return run def _check_sample_evaluations(