-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
Add remote_data on all tests that require network #572
Conversation
Neat, thanks! We used to prevent problems due to internet access this with mocks like this: Lines 159 to 160 in 7880daa
Could you add the Line 76 in f1bd503
|
3ac5da5
to
9944a3b
Compare
I have added a factor |
astroplan/constraints.py
Outdated
@@ -734,7 +734,7 @@ def __init__(self, min=None, max=None): | |||
>>> from astroplan import Observer | |||
>>> from astroplan.constraints import LocalTimeConstraint | |||
>>> import datetime as dt | |||
>>> subaru = Observer.at_site("Subaru", timezone="US/Hawaii") | |||
>>> subaru = Observer.at_site("Subaru", timezone="US/Hawaii") # doctest: +REMOTE_DATA |
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.
Why is subaru
needed here at all? 🤔
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.
It's true, that variable is not used
@@ -127,7 +127,7 @@ def from_name(cls, query_name, name=None, **kwargs): | |||
Examples | |||
-------- | |||
>>> from astroplan import FixedTarget | |||
>>> sirius = FixedTarget.from_name("Sirius") | |||
>>> sirius = FixedTarget.from_name("Sirius") # doctest: +REMOTE_DATA |
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.
Problem with marking lines with remote data, you also need to mark all the subsequent lines derived from here onwards.
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.
Yes, there are some tests where I should mark also the next line
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.
I have also noticed that I was using REMOTE_DATA in some tests that don't need it. I have removed them
* Remove REMOTE_DATA in some test where it wasn't needed
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. |
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 packagepytest-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 anaccident, typically by using
Observer.at_site