Skip to content

Comments

test: replace live API calls with proper mocks in test_api_calls#1680

Open
aryarathoree wants to merge 1 commit intoopenml:mainfrom
aryarathoree:fix-mock-api-calls-tests
Open

test: replace live API calls with proper mocks in test_api_calls#1680
aryarathoree wants to merge 1 commit intoopenml:mainfrom
aryarathoree:fix-mock-api-calls-tests

Conversation

@aryarathoree
Copy link

@aryarathoree aryarathoree commented Feb 21, 2026

With reference to issue #1649

Metadata

  • Reference Issue: NA
  • New Tests Added: Yes
  • Documentation Updated: No
  • Change Log Entry: Replace live API calls with proper mocks in test_api_calls

Details

This PR removes live API dependencies from tests/test_openml/test_api_calls.py and replaces them with properly scoped mocks.

Changes include:

  • Mocking requests.Session instead of performing real HTTP requests.
  • Ensuring authentication endpoints raise OpenMLNotAuthorizedError.
  • Removing @pytest.mark.test_server decorators.
  • Making the Minio cache test OS-stable by comparing mtime instead of ctime.

No production code was modified. All changes are limited to test improvements. Happy to make changes based on feedback. Thankyou!

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