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

[MNT] Replace live server calls with mocks in test_setup_functions.py

Open Sandipmandal25 opened this issue 9 months ago • 0 comments

Metadata

  • Reference Issue: Fixes #1649 (test_setup_functions.py)
  • New Tests Added: No
  • Documentation Updated: No
  • Change Log Entry: "Replace live server calls with mocks in test_setup_functions.py"

Removes @pytest.mark.test_server() from three tests in TestSetupFunctions since they rely on mocking and do not require a live server.

  • test_list_setups_empty: Mocks HTTP 412 (error 674) and verifies empty dict handling.
  • test_setuplist_offset: Mocks paginated responses (offset/0 - 1–10, offset/10 - 11–20) and preserves non-overlap assertion.
  • test_get_cached_setup: Uses existing static cache; no server dependency.

The four tests marked with both @pytest.mark.sklearn() and @pytest.mark.test_server() are unchanged.

Test Run

tests/test_setups/test_setup_functions.py::TestSetupFunctions::test_get_cached_setup PASSED tests/test_setups/test_setup_functions.py::TestSetupFunctions::test_get_uncached_setup PASSED tests/test_setups/test_setup_functions.py::TestSetupFunctions::test_list_setups_empty PASSED tests/test_setups/test_setup_functions.py::TestSetupFunctions::test_setuplist_offset PASSED

4 passed in 0.09s

Sandipmandal25 avatar Feb 20 '26 07:02 Sandipmandal25