Skip to content

Commit 0c37301

Browse files
committed
fix test & make a more informative error
1 parent ee42d01 commit 0c37301

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

astroquery/simbad/core.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,10 @@ def query_region_async(self, coordinates, radius=2*u.arcmin, *,
645645
Response of the query from the server.
646646
"""
647647

648+
if radius is None:
649+
# this message is specifically for deprecated use of 'None' to mean 'Default'
650+
raise ValueError("Radius must be specified as an angle-equivalent quantity, not None")
651+
648652
equinox = validate_equinox(equinox)
649653
epoch = validate_epoch(epoch)
650654

astroquery/simbad/tests/test_simbad.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,10 @@ def test_query_catalog(patch_post):
234234

235235

236236
@pytest.mark.parametrize(('coordinates', 'radius', 'equinox', 'epoch'),
237-
[(ICRS_COORDS, None, 2000.0, 'J2000'),
237+
[(ICRS_COORDS, 2*u.arcmin, 2000.0, 'J2000'),
238238
(GALACTIC_COORDS, 5 * u.deg, 2000.0, 'J2000'),
239239
(FK4_COORDS, '5d0m0s', 2000.0, 'J2000'),
240-
(FK5_COORDS, None, 2000.0, 'J2000'),
240+
(FK5_COORDS, 2*u.arcmin, 2000.0, 'J2000'),
241241
(multicoords, 0.5*u.arcsec, 2000.0, 'J2000'),
242242
(multicoords, "0.5s", 2000.0, 'J2000'),
243243
])
@@ -253,10 +253,10 @@ def test_query_region_async(patch_post, coordinates, radius, equinox, epoch):
253253

254254

255255
@pytest.mark.parametrize(('coordinates', 'radius', 'equinox', 'epoch'),
256-
[(ICRS_COORDS, None, 2000.0, 'J2000'),
256+
[(ICRS_COORDS, 2*u.arcmin, 2000.0, 'J2000'),
257257
(GALACTIC_COORDS, 5 * u.deg, 2000.0, 'J2000'),
258258
(FK4_COORDS, '5d0m0s', 2000.0, 'J2000'),
259-
(FK5_COORDS, None, 2000.0, 'J2000')
259+
(FK5_COORDS, 2*u.arcmin, 2000.0, 'J2000')
260260
])
261261
def test_query_region(patch_post, coordinates, radius, equinox, epoch):
262262
result1 = simbad.core.Simbad.query_region(coordinates, radius=radius,

0 commit comments

Comments
 (0)