Skip to content

Comments

Refactor: Convert server-dependent flow tests to offline mocked tests#1690

Open
VHemanth45 wants to merge 2 commits intoopenml:mainfrom
VHemanth45:MNT/tests
Open

Refactor: Convert server-dependent flow tests to offline mocked tests#1690
VHemanth45 wants to merge 2 commits intoopenml:mainfrom
VHemanth45:MNT/tests

Conversation

@VHemanth45
Copy link

Metadata

Reference Issue: #1649
New Tests Added: Yes (10 new offline mocked test functions)
Documentation Updated: No
Change Log Entry: "Refactor test_flow.py: Convert 11 server-dependent tests to offline mocked tests, improving test speed and CI/CD reliability"

Details:

What does this PR implement?
This PR converts 11 server-dependent tests (marked with @pytest.mark.production_server() or @pytest.mark.test_server()) in test_flow.py to offline unit tests using unittest.mock. The tests now use XML fixture files and mock requests.Session HTTP calls.

What changed:

Created 11 XML fixture files in flows
Converted 10 tests to module-level mocked functions (test_get_flow, test_get_structure, test_tagging, etc.)
Preserved 1 integration test (test_sklearn_to_upload_to_flow) with @pytest.mark.test_server() for end-to-end validation
All 16 tests pass successfully.

Testing

.venv/bin/python -m pytest tests/test_flows/test_flow.py -v

@VHemanth45
Copy link
Author

@geetu040 Please review

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