Skip to content

Commit 890f617

Browse files
committed
Skip tests that need boto3 if it's not installed
Two `mast` remote tests require `boto3`, which is not installed when installing `astroquery` with the test dependencies. It therefore cannot be assumed that `boto3` is installed when running the tests. If it isn't installed then it is better to skip the tests in question than to have them fail with `ModuleNotFoundError`.
1 parent aa9ce56 commit 890f617

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

astroquery/mast/tests/test_mast_remote.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ def test_observations_download_file(self, tmp_path):
386386
assert result == ('COMPLETE', None, None)
387387

388388
def test_get_cloud_uri(self):
389+
pytest.importorskip("boto3")
389390
test_obs_id = '25568122'
390391

391392
# get a product list
@@ -403,6 +404,7 @@ def test_get_cloud_uri(self):
403404
assert len(uri) > 0, f'Product for OBSID {test_obs_id} was not found in the cloud.'
404405

405406
def test_get_cloud_uris(self):
407+
pytest.importorskip("boto3")
406408
test_obs_id = '25568122'
407409

408410
# get a product list

0 commit comments

Comments
 (0)