Skip to content
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

Use has_internet to skip planet tests requiring network #121

Merged
merged 2 commits into from
Mar 16, 2022

Conversation

jeanconn
Copy link
Contributor

@jeanconn jeanconn commented Mar 10, 2022

Description

Use has_internet to skip planet tests requiring network (for GRETA).

Testing

  • Passes unit tests on MacOS and skips planet tests correctly with no internet
  • Functional testing - unit tests run with and without internet (skipped without) are the functional tests (though the maude tests will presently fail for the case of really no internet on a laptop).

@jeanconn jeanconn requested a review from taldcroft March 16, 2022 14:15
@@ -105,6 +110,7 @@ def test_planet_positions_array():
assert np.all(sphere_dist(ra, dec, ra2, dec2) * 3600 < 1.0)


@pytest.mark.skipif('not HAS_INTERNET', reason='Requires network access')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modern preferred style is to write this as

@pytest.mark.skipif(not HAS_INTERNET, reason='Requires network access')

This should work as long as you provide a reason.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I think you told me this already, but when I searched sot for skipif tests I wasn't sure which was the canonical example (and I couldn't remember that the only change was the string to not-string handling...).

Copy link
Member

@taldcroft taldcroft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggested change about skipif is optional but keep this in mind going forward.

@jeanconn jeanconn merged commit 225f439 into master Mar 16, 2022
@jeanconn jeanconn deleted the greta-planet branch March 16, 2022 17:26
@javierggt javierggt mentioned this pull request Mar 30, 2022
@javierggt javierggt mentioned this pull request Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants