-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Don't access internet during tests. #13782
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
Conversation
1b4d015
to
31ce662
Compare
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.
Mostly approve. I do wonder if we should leave the --no-network
option in tests.py
and have it emit a deprecation message, but I am not going to make a big deal about it.
Basically good. However this PR breaks Appveyor (something about the generated style file not found). |
31ce662
to
950c2ec
Compare
I just needed to understand how file:/// uris work on Windows... should be fixed now. |
950c2ec
to
4e1aedf
Compare
4e1aedf
to
8d981c2
Compare
So (unsurprisingly...) this exposed a bug where imread(), when passed in an object constructed with urlopen("file:///..."), would always go through Pillow to open the file (basically, because urlopen("file:///...") returns an object with a .name attribute). The Appveyor tests would then fail because Pillow is not installed. |
8d981c2
to
cbc4172
Compare
Good to go now :) |
@@ -39,17 +39,10 @@ | |||
from matplotlib import test | |||
|
|||
parser = argparse.ArgumentParser(add_help=False) | |||
parser.add_argument('--no-network', action='store_true', |
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.
Might be better to leave this for the sake of anyone who needs to suppress network access and test more than one version of matplotlib?
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.
They can always use -m 'not network'
; mentioned this in changelog.
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.
modulo ether restoring the cli flag or adding an API changes note
The tests that style.use() and imread() support urls can just use local urls (`file:`); this avoids failing the tests when downloading the gist fails due to a flaky connection. Since RFC8089 file: urls don't necessarily start with two slashes anymore.
cbc4172
to
422d1ae
Compare
attn @sandrotosi |
thanks for the heads up! i dont think this will be a problem, as in Debian we already split the packages for the 2.x and 3.x releases |
The tests that style.use() and imread() support urls can just use local
urls (
file://
); this avoids failing the tests when downloading thegist fails due to a flaky connection.
Since RFC8089 file: urls don't necessarily start with two slashes
anymore (https://tools.ietf.org/html/rfc8089#appendix-A).
(If we really want to test https we could use http.server to spin up a local server but that seems overkill.)
PR Summary
PR Checklist