-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix redirection in download tests #3568
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3568 +/- ##
=======================================
Coverage 79.07% 79.07%
=======================================
Files 105 105
Lines 9787 9787
Branches 1572 1572
=======================================
Hits 7739 7739
Misses 1567 1567
Partials 481 481 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@@ -150,7 +162,7 @@ def assert_server_response_ok(): | |||
|
|||
|
|||
def assert_url_is_accessible(url, timeout=5.0): | |||
request = Request(url, headers={"method": "HEAD", "User-Agent": USER_AGENT}) | |||
request = Request(url, headers={"User-Agent": USER_AGENT}, method="HEAD") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for my understanding: is this a cosmetic change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't mean to include this. It was just for testing. But it shouldn't matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, if you want to revert this change in a follow-up PR I'm ok with it
Summary: Co-authored-by: Francisco Massa <fvsmassa@gmail.com> Reviewed By: fmassa Differential Revision: D27128005 fbshipit-source-id: fdafdf85a8286a2bbd7e379229cccfdd84b47513
Before we never updated the initial
request
to incorporate the redirectionvision/test/test_datasets_download.py
Lines 56 to 65 in 9d27878
Furthermore, after #3560 has landed, we can now use
datasets.utils._get_redirect_url
instead of duplicating the functionality withoutrequests
.