openml-python icon indicating copy to clipboard operation
openml-python copied to clipboard

Migrate test_setups to pytest

Open anirudhsengar opened this issue 1 month ago • 0 comments

Metadata

  • Reference Issue: Part of https://github.com/openml/openml-python/issues/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.

anirudhsengar avatar Nov 15 '25 09:11 anirudhsengar