From eb5fd3a92a8f70d5d60c8950d0776239faa1d796 Mon Sep 17 00:00:00 2001 From: Anika Kothari Date: Sun, 13 Sep 2026 03:29:15 +0530 Subject: [PATCH] [MNT] Add assertions to run function tests --- tests/test_runs/test_run_functions.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/tests/test_runs/test_run_functions.py b/tests/test_runs/test_run_functions.py index 38128de30..f380a8eb2 100644 --- a/tests/test_runs/test_run_functions.py +++ b/tests/test_runs/test_run_functions.py @@ -342,11 +342,11 @@ 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 - run.trace.trace_to_arff() + trace_arff = run.trace.trace_to_arff() + assert trace_arff["relation"] == "Trace" + assert len(trace_arff["data"]) > 0 # check arff output assert len(run.data_content) == num_instances @@ -395,12 +395,8 @@ 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) + if run.trace is not None: + assert downloaded.trace is not None return run def _check_sample_evaluations(