[MNT] Add Missing Assertions to Run Function Tests

Open Beginner friendly
#1,646 7 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
testing-qa

Research direction

Start by reviewing the TODO comments and surrounding tests in tests/test_runs/test_run_functions.py, especially around lines 170, 287, 291, 341, 514, and 555. Add assertions for the holdout task type, runtime presence, and parameters as applicable, then run the relevant tests. Done means the intended checks are deterministic and the tests pass.

Written by the indexing model from the issue text.

Description

Good First Issue module:Run testing

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.

Dominant language
Python
Stars
361
Forks
296
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openml/openml-python

All issues in openml/openml-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.