Skip to content

Migrate test_setups to pytest - #1442

Merged
PGijsbers merged 3 commits into
openml:mainfrom
anirudhsengar:migrate/test_setups
Oct 19, 2026
Merged

PGijsbers merged 3 commits into
openml:mainfrom
anirudhsengar:migrate/test_setups

Conversation

@anirudhsengar

Copy link
Copy Markdown
Contributor

Metadata

  • Reference Issue: Part of Migrate all unittests to pytest #1252
  • New Tests Added: Yes (migrate existing tests to pytest style)
  • Documentation Updated: No
  • Change Log Entry: “Migrate test_setups/test_setup_functions.py to pytest-style tests”

Details

  • This PR migrates test_setup_functions.py from unittest.TestCase-based tests (openml.testing.TestBase) to pure pytest-style tests.
  • It replaces the class-based TestSetupFunctions with module-level test functions and introduces a pytest fixture sklearn_extension() to provide the SklearnExtension instance previously created in setUp().
  • The helper method _existing_setup_exists() is extracted as a standalone function that accepts sklearn_extension as a parameter.
  • Tests that require the static cache directory now use the existing static_cache_dir fixture from conftest.py.
  • Assertions continue to use assert and pytest.raises, consistent with the style already used in test_utils.py.
  • Calls to TestBase._mark_entity_for_removal() and TestBase.logger are preserved for tracking entities uploaded to the test server during cleanup.
  • No functional changes to the OpenML setups API are introduced; only the test implementation is refactored.

Copilot AI balanced review requested due to automatic review settings October 19, 2026 13:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.84%. Comparing base (aee8627) to head (84fd105).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1442      +/-   ##
==========================================
- Coverage   53.99%   53.84%   -0.16%     
==========================================
  Files          63       63              
  Lines        5230     5230              
==========================================
- Hits         2824     2816       -8     
- Misses       2406     2414       +8     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@PGijsbers

Copy link
Copy Markdown
Collaborator

Thanks for your contribution!

@PGijsbers
PGijsbers merged commit d43498f into openml:main Oct 19, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants