Skip to content

Comments

[MNT] Replace live server call with mock in test_evaluation_list_filter_run#1672

Open
anuj452005 wants to merge 1 commit intoopenml:mainfrom
anuj452005:mock-test-evaluation-filter-run
Open

[MNT] Replace live server call with mock in test_evaluation_list_filter_run#1672
anuj452005 wants to merge 1 commit intoopenml:mainfrom
anuj452005:mock-test-evaluation-filter-run

Conversation

@anuj452005
Copy link

@anuj452005 anuj452005 commented Feb 20, 2026

Metadata

Details

What does this PR implement/fix?

Converts test_evaluation_list_filter_run in tests/test_evaluations/test_evaluation_functions.py
from a @pytest.mark.production_server test (requiring a live connection to openml.org)
into an offline unit test using unittest.mock.

What was changed?

  • Removed TestEvaluationFunctions.test_evaluation_list_filter_run (production_server class method)
  • Added module-level test_evaluation_list_filter_run using @mock.patch.object(requests.Session, "get")
  • Added tests/files/mock_responses/evaluations/evaluation_list_run12.xml
  • Added tests/files/mock_responses/evaluations/user_list_1.xml

Note: __list_evaluations makes two sequential GET calls internally (evaluation list + user lookup),
so both are intercepted using mock_get.side_effect = [eval_response, user_response].

How to reproduce / verify:

pytest tests/test_evaluations/test_evaluation_functions.py::test_evaluation_list_filter_run -v

@anuj452005
Copy link
Author

@geetu040 Hi !! can you please give review .

@anuj452005 anuj452005 changed the title test(evaluations): mock test_evaluation_list_filter_run to remove pro… [MNT] Replace live server call with mock in test_evaluation_list_filter_run Feb 20, 2026
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.

1 participant