-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: Use pytest-localserver instead of making network connections #53828
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
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.
This looks awesome! Just a few questions.
It is highly discouraged to add a test that connects to the internet due to flakiness of network connections and | ||
lack of ownership of the server that is being connected to. If network connectivity is absolutely required, use the | ||
``tm.network`` decorator. | ||
lack of ownership of the server that is being connected to. If network connectivity is absolutely required, mock |
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.
With this, are these still highly discouraged? Seems like all the reasons to discourage them no longer apply.
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.
Good point I'll clarify the wording here, "highly discouraged" is probably too strong if they can be mocked properly
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.
lgtm
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.
nice idea
This broke the env on ARM Mac. pytest local server requires aiosmtpd which isn't available on Mac Edit: Does anyone have bandwidth to look into it? Otherwise I'd revert this for now |
I am OK with revert unless @mroeschke has an objection |
Could we just remove pytest localserver from environment.yaml? This plugin helps save a few minutes from CI runtime and having the network rests run locally probably isn't a huge priority |
…ndas-dev#53828) * Use pytest-localserver instead of making network connections * Fix test, remove network function * remove network from init * Ignore disutils from datareader, s3so * specify encoding * Specify encoding * Clarify contributing doc
Since we have a lot of CI jobs with unit test that make network connections, it is better if the network connections could be made locally if possible. This PR refactors all tests that make network connections to use
pytest-localserver
instead