catch more nulls
@@ -183,6 +183,7 @@ class TestSimbad:
def test_null_response(self, temp_dir, function):
simbad = Simbad()
simbad.cache_location = temp_dir
+ with pytest.warns(BadRowWarning):
assert (simbad.__getattribute__(function)('idonotexist')
is None)
@@ -190,12 +191,14 @@ class TestSimbad:
def test_query_objects_null(self, temp_dir):
simbad = Simbad()
simbad.cache_location = temp_dir
+ with pytest.warns(BadRowWarning):
assert simbad.query_objects(['idonotexist', 'idonotexisteither']) is None
# Special case of null test: zero-sized region
def test_query_region_null(self, temp_dir):
simbad = Simbad()
simbad.cache_location = temp_dir
+ with pytest.warns(BadRowWarning):
result = simbad.query_region(SkyCoord("00h01m0.0s 00h00m0.0s"), radius="0d",
equinox=2000.0, epoch='J2000')
assert result is None
@@ -204,6 +207,7 @@ class TestSimbad:
def test_query_small_region_null(self, temp_dir):
simbad = Simbad()
simbad.cache_location = temp_dir
+ with pytest.warns(BadRowWarning):
result = simbad.query_region(SkyCoord("00h01m0.0s 00h00m0.0s"), radius=1.0 * u.marcsec,
equinox=2000.0, epoch='J2000')
assert result is None
