openml-python
openml-python copied to clipboard
Migrate test_setups to pytest
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
TestSetupFunctionswith module-level test functions and introduces a pytest fixturesklearn_extension()to provide theSklearnExtensioninstance previously created insetUp(). - The helper method
_existing_setup_exists()is extracted as a standalone function that acceptssklearn_extensionas a parameter. - Tests that require the static cache directory now use the existing
static_cache_dirfixture from conftest.py. - Assertions continue to use
assertandpytest.raises, consistent with the style already used in test_utils.py. - Calls to
TestBase._mark_entity_for_removal()andTestBase.loggerare 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.