openml-python
openml-python copied to clipboard
Migrate test_evaluations to pytest
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
TestBaseclass inheritance and converted all class-based test methods to module-level test functions. Replacedself.assertSequenceEqual()with plainassertstatements and converted the helper method_check_list_evaluation_setupsto a standalone function. Tests that use thelong_versionoption now access it directly viarequest.config.getoption("--long")instead of relying on the class-scoped fixture. - test_evaluations_example.py: Removed
unittest.TestCaseclass structure and converted the test method to a standalone pytest functiontest_example_python_paper(). Theoverwrite_config_contextpattern is preserved. - Server configuration (production vs. test) is now handled automatically by the
with_serverfixture in conftest.py, eliminating the need for explicitself.use_production_server()calls. - All assertions now use plain
assertstatements 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.