Skip to content

Commit

Permalink
TST: parametrize surveys to see which one fails
Browse files Browse the repository at this point in the history
  • Loading branch information
bsipocz committed Dec 20, 2023
1 parent 9387c45 commit 94cf2b1
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions astroquery/eso/tests/test_eso_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,29 +157,28 @@ def test_each_instrument_SgrAstar(self, tmp_path):
else:
assert len(result) > 0

def test_each_survey_and_SgrAstar(self, tmp_path):
@pytest.mark.parametrize("survey", Eso().list_surveys(cache=False))
def test_each_survey_and_SgrAstar(self, tmp_path, survey):
eso = Eso()
eso.cache_location = tmp_path
eso.ROW_LIMIT = 5

surveys = eso.list_surveys(cache=False)
for survey in surveys:
if survey in SGRA_SURVEYS:
if survey in SGRA_SURVEYS:
result_s = eso.query_surveys(surveys=survey, coord1=266.41681662,
coord2=-29.00782497,
box='01 00 00',
cache=False)
assert len(result_s) > 0
else:
with pytest.warns(NoResultsWarning):
result_s = eso.query_surveys(surveys=survey, coord1=266.41681662,
coord2=-29.00782497,
box='01 00 00',
cache=False)
assert len(result_s) > 0
else:
with pytest.warns(NoResultsWarning):
result_s = eso.query_surveys(surveys=survey, coord1=266.41681662,
coord2=-29.00782497,
box='01 00 00',
cache=False)
assert result_s is None

generic_result = eso.query_surveys(surveys=survey)
assert len(generic_result) > 0
assert result_s is None

generic_result = eso.query_surveys(surveys=survey)
assert len(generic_result) > 0

def test_mixed_case_instrument(self, tmp_path):
eso = Eso()
Expand Down

0 comments on commit 94cf2b1

Please sign in to comment.