Skip to content

[MNT] Replace live server calls with mocks in test_run_functions.py#1681

Open
Jay2006sawant wants to merge 1 commit intoopenml:mainfrom
Jay2006sawant:mnt/mock-test-run-functions
Open

[MNT] Replace live server calls with mocks in test_run_functions.py#1681
Jay2006sawant wants to merge 1 commit intoopenml:mainfrom
Jay2006sawant:mnt/mock-test-run-functions

Conversation

@Jay2006sawant
Copy link

Metadata

Details

This PR replaces live test-server calls with local mocks/constructs in tests/test_runs/test_run_functions.py as part of #1649.

7 tests converted:

  • test_format_prediction_classification_no_probabilities — direct OpenMLClassificationTask construction instead of get_task()
  • test_format_prediction_classification_incomplete_probabilities — same
  • test_format_prediction_task_without_classlabels_set — same
  • test_format_prediction_task_learning_curve_sample_not_set — direct OpenMLLearningCurveTask construction
  • test_format_prediction_task_regression — direct OpenMLRegressionTask construction, removed check_task_existence/create_task/publish server logic
  • test_list_runs_empty — mocks _perform_api_call to raise OpenMLServerNoResult
  • test_get_cached_run — removed @pytest.mark.test_server() (only reads from local static cache)

All 7 tests now run fully offline without hitting any server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MNT] Replace Live Server Calls with Mocks in Unit Tests

1 participant