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

Migrate test_evaluations 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 (migrated existing tests to pytest style)
  • Documentation Updated: No
  • Change Log Entry: "Migrate tests/test_evaluations to pytest-style tests"

Details

  • This PR migrates all test files in test_evaluations from unittest.TestCase-based tests to pure pytest-style tests.
  • test_evaluation_functions.py: Removed TestBase class inheritance and converted all class-based test methods to module-level test functions. Replaced self.assertSequenceEqual() with plain assert statements and converted the helper method _check_list_evaluation_setups to a standalone function. Tests that use the long_version option now access it directly via request.config.getoption("--long") instead of relying on the class-scoped fixture.
  • test_evaluations_example.py: Removed unittest.TestCase class structure and converted the test method to a standalone pytest function test_example_python_paper(). The overwrite_config_context pattern is preserved.
  • Server configuration (production vs. test) is now handled automatically by the with_server fixture in conftest.py, eliminating the need for explicit self.use_production_server() calls.
  • All assertions now use plain assert statements consistent with pytest best practices and the style already used in test_utils.
  • No functional changes to the OpenML evaluations API are introduced; only the test implementation is refactored.

anirudhsengar avatar Nov 15 '25 10:11 anirudhsengar