astropy / astroplan

Observation planning package for astronomers – maintainer @bmorris3
https://astroplan.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
198 stars 109 forks source link

Add remote_data on all tests that require network #572

Open sergiopasra opened 11 months ago

sergiopasra commented 11 months ago

This PR implements a first step towards the goal of running the tests of astroplan without network access. I'm using the decorator @pytest.mark.remote_data from the package pytest-remotedata, which is currently in the dependencies. In the long term, I would like to check one by one the marked tests and see if the network access is actually required or if it is an accident, typically by using Observer.at_site

bmorris3 commented 2 weeks ago

Neat, thanks! We used to prevent problems due to internet access this with mocks like this:

https://github.com/astropy/astroplan/blob/7880daad50733fc4d5c6df0a6fd077bac3fefe39/docs/conf.py#L159-L160

Could you add the --remote-data flag to the test matrix, e.g. here:

https://github.com/astropy/astroplan/blob/f1bd5036534667e81339dc8f582c7ca0a03bdca2/tox.ini#L76

sergiopasra commented 1 week ago

I have added a factor -remote that enables remote data in all tests. The tests without -remote use only local data. If you prefer that -cov tests are run always with remote data, it can be done also.