Use httpx for download example uploads
Using requests
with streaming leads to test errors sometimes depending on the fixture setup. This leads to an httpx
client being used in test, which doesn't support stream = true
. Streaming downloads is supported using httpx.stream
function instead.
FAILED tests/config/models/test_plugins.py::test_example_upload_entry_point_valid[load with url] - TypeError: TestClient.get() got an unexpected keyword argument 'stream'
FAILED tests/config/models/test_plugins.py::test_example_upload_entry_point_invalid[cannot find url] - AssertionError: Regex pattern did not match.
Regex: 'Could not fetch the example upload from URL: https://test.zip'
Input: "TestClient.get() got an unexpected keyword argument 'stream'"
= 2 failed, 598 passed, 8 skipped, 2888 deselected, 51 warnings in 561.98s (0:09:21)
This MR moves the download function to use httpx
to avoid this discrepancy.
Edited by Ahmed Ilyas