astroplan icon indicating copy to clipboard operation
astroplan copied to clipboard

Add remote_data on all tests that require network

Open sergiopasra opened this issue 2 years ago • 2 comments

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

sergiopasra avatar Sep 29 '23 07:09 sergiopasra

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

bmorris3 avatar Aug 12 '24 18:08 bmorris3

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.

sergiopasra avatar Aug 21 '24 14:08 sergiopasra

Thank you very much for smoking out the remote data tests, @sergiopasra ! I took some liberty to push follow up commits here. Hope you don't mind.

pllim avatar Dec 05 '24 17:12 pllim