Skip mast
remote tests that need boto3
if it is not installed
#2755
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If
astroquery
is installed withpip install astroquery[test]
thenpytest --remote-data=any -k test_get_cloud_uri astroquery/mast
results in two tests failing withModuleNotFoundError: No module named 'boto3'
because althoughboto3
is listed among theall
dependencies, it is not listed among thetest
dependencies:astroquery/setup.cfg
Lines 136 to 140 in aa9ce56
astroquery/setup.cfg
Lines 127 to 131 in aa9ce56
The tests therefore cannot assume that
boto3
is installed. There are two simple solutions to this problem. One would be to addboto3
to the test dependencies, but adding a whole new dependency only for the two remote tests inmast
is in my opinion excessive. This pull request implements the other simple option, which is to check whetherboto3
is installed in the two tests that require it and to skip them if it isn't.