-
Notifications
You must be signed in to change notification settings - Fork 70
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
Make sure that any test that uses the network is properly marked #367
Comments
@tarunsamanta2k20 I don't know if what I am going to suggest is anywhere close to correct but this is what came to mind reading this: First I would edit Makefile to duplicate the "test" target and add
Based on https://docs.pytest.org/en/7.1.x/example/markers.html this should tell pytest to skip the tests that are labeled with "@pytest.mark.network". After adding the new target to Makefile you should be able to run But I don't know how cache's affect things and whether pooch's tests already bypass cache. I suspect there's a way to point pooch at a temporary empty directory instead of the default cache. From there you can probably figure out which tests are using network by comparing runs of This is just my initial idea about how to go about it. At some point someone might think about whether there's an automated way to detect whether tests have been incorrectly marked as |
We use a special
network
pytest mark to allow easily remove/select tests that require network access. From #331, it seems that not all our tests are properly marked as such.It would be good to over the
pooch/tests
package and make sure that all test functions that access the internet are properly tagged (seepooch/pooch/tests/test_core.py
Line 62 in 9c57dd3
The text was updated successfully, but these errors were encountered: