|
10 | 10 | from astroquery.simbad import Simbad
|
11 | 11 | # Maybe we need to expose SimbadVOTableResult to be in the public API?
|
12 | 12 | from astroquery.simbad.core import SimbadVOTableResult
|
13 |
| -from astroquery.exceptions import BadRowWarning |
| 13 | +from astroquery.exceptions import BlankResponseWarning |
14 | 14 |
|
15 | 15 |
|
16 | 16 | # M42 coordinates
|
@@ -149,7 +149,7 @@ def test_query_multi_object(self, temp_dir):
|
149 | 149 | assert len(result) == 2
|
150 | 150 | assert len(result.errors) == 0
|
151 | 151 |
|
152 |
| - with pytest.warns(BadRowWarning): |
| 152 | + with pytest.warns(BlankResponseWarning): |
153 | 153 | result = simbad.query_objects(['M32', 'M81', 'gHer'])
|
154 | 154 | # 'gHer' is not a valid Simbad identifier - it should be 'g Her' to
|
155 | 155 | # get the star
|
@@ -183,31 +183,23 @@ def test_query_object_ids(self, temp_dir):
|
183 | 183 | def test_null_response(self, temp_dir, function):
|
184 | 184 | simbad = Simbad()
|
185 | 185 | simbad.cache_location = temp_dir
|
186 |
| - with pytest.warns(BadRowWarning): |
| 186 | + with pytest.warns(BlankResponseWarning): |
187 | 187 | assert (simbad.__getattribute__(function)('idonotexist')
|
188 | 188 | is None)
|
189 | 189 |
|
190 | 190 | # Special case of null test: list of nonexistent parameters
|
191 | 191 | def test_query_objects_null(self, temp_dir):
|
192 | 192 | simbad = Simbad()
|
193 | 193 | simbad.cache_location = temp_dir
|
194 |
| - with pytest.warns(BadRowWarning): |
| 194 | + with pytest.warns(BlankResponseWarning): |
195 | 195 | assert simbad.query_objects(['idonotexist', 'idonotexisteither']) is None
|
196 | 196 |
|
197 |
| - # Special case of null test: zero-sized region |
198 |
| - def test_query_region_null(self, temp_dir): |
| 197 | + # Special case of null test: zero-size and very small region |
| 198 | + @pytest.mark.parametrize('radius', ["0d", 1.0*u.marcsec]) |
| 199 | + def test_query_region_null(self, temp_dir, radius): |
199 | 200 | simbad = Simbad()
|
200 | 201 | simbad.cache_location = temp_dir
|
201 |
| - with pytest.warns(BadRowWarning): |
202 |
| - result = simbad.query_region(SkyCoord("00h01m0.0s 00h00m0.0s"), radius="0d", |
203 |
| - equinox=2000.0, epoch='J2000') |
204 |
| - assert result is None |
205 |
| - |
206 |
| - # Special case of null test: very small region |
207 |
| - def test_query_small_region_null(self, temp_dir): |
208 |
| - simbad = Simbad() |
209 |
| - simbad.cache_location = temp_dir |
210 |
| - with pytest.warns(BadRowWarning): |
| 202 | + with pytest.warns(BlankResponseWarning): |
211 | 203 | result = simbad.query_region(SkyCoord("00h01m0.0s 00h00m0.0s"), radius=1.0 * u.marcsec,
|
212 | 204 | equinox=2000.0, epoch='J2000')
|
213 | 205 | assert result is None
|
|
0 commit comments