Skip to content

Comments

[MNT] Replace live server call with mock in test_setup_list_filter_flow (test_setups/test_setup_functions.py)#1673

Open
anuj452005 wants to merge 1 commit intoopenml:mainfrom
anuj452005:mock-test-setup-list-filter-flow
Open

[MNT] Replace live server call with mock in test_setup_list_filter_flow (test_setups/test_setup_functions.py)#1673
anuj452005 wants to merge 1 commit intoopenml:mainfrom
anuj452005:mock-test-setup-list-filter-flow

Conversation

@anuj452005
Copy link

Metadata

Details

What does this PR implement/fix?

Converts test_setup_list_filter_flow in tests/test_setups/test_setup_functions.py
from a @pytest.mark.production_server test into an offline unit test using unittest.mock.

What was changed?

  • Removed TestSetupFunctions.test_setup_list_filter_flow (production_server class method)
  • Added module-level test_setup_list_filter_flow using @mock.patch.object(requests.Session, "get")
  • Added tests/files/mock_responses/setups/setup_list_flow5873.xml

Implementation note:

__list_setups in functions.py wraps each parsed <oml:setup> element as
{"oml:setup_parameters": setup_} in Python before passing to _create_setup_from_xml.
So the fixture XML places oml:setup_id and oml:flow_id directly inside <oml:setup>
(not nested under <oml:setup_parameters>).

How to verify:

pytest tests/test_setups/test_setup_functions.py::test_setup_list_filter_flow -v

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