openml-python icon indicating copy to clipboard operation
openml-python copied to clipboard

test: replace live API calls with proper mocks in test_api_calls

Open aryarathoree opened this issue 9 months ago • 1 comments

With reference to issue https://github.com/openml/openml-python/issues/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!

aryarathoree avatar Feb 21 '26 07:02 aryarathoree

Hi @geetu040, please give a review to the pr

aryarathoree avatar Feb 25 '26 04:02 aryarathoree