Skip to content

[MNT] Add Missing Assertions to Run Function Tests #1646

Open

Description

@geetu040

Several tests in test_run_functions.py have TODO comments indicating missing assertions (e.g., lines 170, 287, 291, 341, 514, 555). These include checks for holdout tasks, parameter presence, and runtime values, which would improve test reliability.

Steps:

  1. Review each TODO comment and the surrounding test code to understand what's being tested.
  2. Add appropriate assertions, such as:
    • assert task.task_type == "holdout" for holdout task checks.
    • assert "runtime" in run.attributes for runtime presence.
    • assert len(run.parameters) > 0 for parameter checks.
  3. Run the tests to ensure they pass and cover the intended behavior.
  4. If needed, mock or set up test data to make assertions deterministic.

Tests will be more comprehensive, catching regressions in run handling and parameter validation.

Activity

  1. vanshg101 commented on Feb 18, 2026

    @vanshg101

    The fix seems straightforward. The TODOs are mostly just missing assert statements after code that already runs correctly. For the holdout check (line 170), we just need to fetch the task and verify the estimation procedure type. The XML/ARFF ones (287, 291) are literally just capturing the return values and checking theyare not empty/have the right keys... The runtime one (555) is the same idea assert the keys exist before the timing helper tries to use them...

    Line 514 I'd leave alone, that's a refactoring suggestion not a missing assertion.

    Raising a PR with this approach!

  2. Abhishek9639 commented on Mar 7, 2026

    @Abhishek9639
    Contributor

    Hi @geetu040,
    I would like to work on this issue.
    I’ll go through the TODO comments in "test_run_functions.py" and add the appropriate assertions as suggested.
    Please let me know if there is anything specific I should keep in mind.
    Thanks

  3. added a commit that references this issue on Mar 7, 2026
  4. Pg1910 commented on Mar 8, 2026

    @Pg1910

    I have read the code and these were my intuitions :-
    line(170) -Here,the clean assertion is to verify that the referenced run belongs to a holdout task before comparing predictions.
    line(287)and (291) - for run._to_xml(),it actually returns a non-empty XML string ,for run.trace.trace_to_arff(),it returns a valid ARFF-style dictionary. these are just smoke . for assertion we can check serialization as well.
    line(341) -- compare the local trace with the downloaded trace fetched explicitly from the trace endpoint.
    line(514) -- here we need to add a second deterministic test and keep the original one as backend integration.

    opening a PR with my approach/inference .

  5. Aishu-ks commented on Aug 12, 2026

    @Aishu-ks

    Hi! I'd like to work on this issue. I plan to add the missing assertions to the affected tests and run the relevant test suite to verify the changes.

  6. rishabhkumaryadav commented on Sep 5, 2026

    @rishabhkumaryadav

    /claim

  7. P0llyanna commented on Sep 14, 2026

    @P0llyanna

    Hi! I’d like to work on this issue as my first contribution to openml-python. I’ll take a look at the missing assertions and add the corresponding tests.

  8. Bhoomika910 commented on Sep 17, 2026

    @Bhoomika910

    Hi, I'd like to work on this issue. I will review the TODOs in test_run_functions.py, add the appropriate assertions, and run the relevant tests.

  9. Gaurav-Kanse commented on Sep 26, 2026

    @Gaurav-Kanse

    Hi! I'd like to work on this issue. I can take care of adding the missing assertions and updating the relevant tests.

  10. AtharvaManale commented on Oct 1, 2026

    @AtharvaManale

    I’ve implemented a subset of the missing assertions from this issue and opened a PR for review.

    The changes currently cover:

    • asserting that the task associated with the run uses the holdout estimation procedure;
    • asserting that the run trace is instantiated and preserved when the run is downloaded.

    I’ve intentionally left the other TODOs in test_run_functions.py unchanged, including the server-dependent initialize_model_from_trace mocking TODO and the runtime check in fold_evaluations has been already validated using _check_fold_timing_evaluations functions

    PR: #1758

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good First IssueIssues suitable for people new to contributing to openml-python!module:RunOpenML concepttesting

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions