Skip to content

Commit 9fc1051

Browse files
committed
MAINT: fixing pytest9.1 incompatibilities
1 parent 5ee0d2c commit 9fc1051

5 files changed

Lines changed: 18 additions & 18 deletions

File tree

astroquery/besancon/tests/test_besancon.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ def data_path(filename):
3535

3636

3737
@pytest.mark.parametrize(('filename', 'length', 'ncols', 'd1', 'mv1'),
38-
zip(DATA_FILES, (13, 6), (18, 24), (0.091, 0.111),
39-
(10.20, 9.70)))
38+
list(zip(DATA_FILES, (13, 6), (18, 24), (0.091, 0.111),
39+
(10.20, 9.70))))
4040
def test_reader(filename, length, ncols, d1, mv1):
4141
besancon_model = data_path(filename)
4242
with open(besancon_model, 'r') as f:

astroquery/esasky/tests/test_esasky_remote.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ def test_esasky_query_ids_spectra(self):
6868
assert "1342246640" in result["HERSCHEL"].columns["observation_id"]
6969

7070
@pytest.mark.parametrize("mission, obsid",
71-
zip(["SUZAKU", "ISO-IR", "Chandra", "XMM-OM-OPTICAL",
72-
"XMM", "XMM-OM-UV", "HST-IR", "Herschel",
73-
"Spitzer", "HST-UV", "HST-OPTICAL", "INTEGRAL"],
74-
["100001010", "01500403", "21171", "0852000101",
75-
"0851180201", "0851180201", "n3tr01c3q", "1342247257",
76-
"30002561-25100", "hst_07553_3h_wfpc2_f160bw_pc", "ocli05leq", "88600210001"]))
71+
list(zip(["SUZAKU", "ISO-IR", "Chandra", "XMM-OM-OPTICAL",
72+
"XMM", "XMM-OM-UV", "HST-IR", "Herschel",
73+
"Spitzer", "HST-UV", "HST-OPTICAL", "INTEGRAL"],
74+
["100001010", "01500403", "21171", "0852000101",
75+
"0851180201", "0851180201", "n3tr01c3q", "1342247257",
76+
"30002561-25100", "hst_07553_3h_wfpc2_f160bw_pc", "ocli05leq", "88600210001"])))
7777
def test_esasky_get_images_obs_id(self, tmp_path, mission, obsid):
7878
result = ESASky.get_images(observation_ids=obsid,
7979
missions=mission, download_dir=tmp_path)
@@ -89,10 +89,10 @@ def test_esasky_get_images_obs_id(self, tmp_path, mission, obsid):
8989
hdu_list.close()
9090

9191
@pytest.mark.parametrize("mission, observation_id",
92-
zip(["ISO-IR", "Chandra", "IUE", "XMM-NEWTON",
93-
"HST-IR", "Herschel", "HST-UV", "HST-OPTICAL"],
94-
["02101201", "1005", "LWR13178", "0001730201",
95-
"ibh706cqq", "1342253595", "z1ax0102t", "oeik2s020"]))
92+
list(zip(["ISO-IR", "Chandra", "IUE", "XMM-NEWTON",
93+
"HST-IR", "Herschel", "HST-UV", "HST-OPTICAL"],
94+
["02101201", "1005", "LWR13178", "0001730201",
95+
"ibh706cqq", "1342253595", "z1ax0102t", "oeik2s020"])))
9696
def test_esasky_get_spectra_obs_id(self, tmp_path, mission, observation_id):
9797
result = ESASky.get_spectra(observation_ids=observation_id,
9898
missions=mission, download_dir=tmp_path)
@@ -135,8 +135,8 @@ def test_esasky_get_images_for_erosita(self, tmp_path):
135135

136136
@pytest.mark.bigdata
137137
@pytest.mark.parametrize('mission, position',
138-
zip(['JWST-MID-IR', 'JWST-NEAR-IR'],
139-
['340.50123388127435 -69.17904779241904', '225.6864099965157 -3.0315781490149467']))
138+
list(zip(['JWST-MID-IR', 'JWST-NEAR-IR'],
139+
['340.50123388127435 -69.17904779241904', '225.6864099965157 -3.0315781490149467'])))
140140
def test_esasky_get_images_jwst(self, tmp_path, mission, position):
141141
result = ESASky.get_images(position=position, missions=mission, download_dir=tmp_path)
142142
assert tmp_path.stat().st_size

astroquery/linelists/cdms/tests/test_cdms_remote.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def test_remote_all_species():
238238
class TestRegressionAllCats:
239239
species_table = CDMS.get_species_table(write_new_species_cache=False)
240240

241-
@pytest.mark.parametrize('row', species_table)
241+
@pytest.mark.parametrize('row', list(species_table))
242242
def test_regression_allcats(self, row):
243243
"""
244244
Expensive test - try all the molecules

astroquery/linelists/jplspec/tests/test_jplspec_remote.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ class TestRegressionAllMolecules:
239239
"""Test that we can get each molecule in JPL database"""
240240
species_table = JPLSpec.get_species_table()
241241

242-
@pytest.mark.parametrize('row', species_table)
242+
@pytest.mark.parametrize('row', list(species_table))
243243
def test_regression_all_molecules(self, row):
244244
"""
245245
Expensive test - try all the molecules
@@ -254,5 +254,5 @@ def test_regression_all_molecules(self, row):
254254
# N2O = 44009 is just not there
255255
pytest.skip("Skipping O2 due to masked QNs")
256256
tbl = JPLSpec.get_molecule(mol_id)
257-
assert isinstance(tbl, Table)
257+
assert isinstance(tbl, (Table,))
258258
assert len(tbl) > 0

astroquery/skyview/tests/test_skyview_remote.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def setup_class(cls):
3636

3737
@pytest.mark.parametrize(('survey',
3838
'survey_data'),
39-
zip(survey_dict.keys(), survey_dict.values()))
39+
list(zip(survey_dict.keys(), survey_dict.values())))
4040
def test_survey(self, survey, survey_data):
4141
# The print should help discover changes
4242
print("Survey: {0} \n Canned reference return: {1} \n"

0 commit comments

Comments
 (0)