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

Migrate test_extensions 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_extensions/test_functions.py to pytest-style tests”

Details

  • This PR migrates test_functions.py from unittest.TestCase-based tests (openml.testing.TestBase) to pure pytest-style tests.
  • It replaces the class-based TestInit with module-level test functions and introduces a small pytest fixture to manage the registration state of dummy extensions used in the tests.
  • The new clean_test_extensions fixture calls the existing _unregister() helper before and after each test, ensuring the global extension registry is not polluted across tests.
  • Assertions continue to use assert and pytest.raises, consistent with the style already used in test_utils.py.
  • No functional changes to the OpenML extensions API are introduced; only the test implementation is refactored.

anirudhsengar avatar Nov 15 '25 08:11 anirudhsengar