|
11 | 11 | # Maybe we need to expose SimbadVOTableResult to be in the public API? |
12 | 12 | from astroquery.simbad.core import SimbadVOTableResult |
13 | 13 | from astroquery.exceptions import BlankResponseWarning |
14 | | -from packaging import version |
15 | | -from pyvo import __version__ as pyvo_version |
16 | | -try: |
17 | | - # This requires pyvo 1.4 |
18 | | - from pyvo.dal.exceptions import DALOverflowWarning |
19 | | -except ImportError: |
20 | | - pass |
| 14 | + |
| 15 | +from pyvo.dal.exceptions import DALOverflowWarning |
21 | 16 |
|
22 | 17 |
|
23 | 18 | # M42 coordinates |
@@ -273,11 +268,9 @@ def test_query_tap(self): |
273 | 268 | expect = "letters numbers\n------- -------\n a 1\n b 2\n c 3" |
274 | 269 | assert expect == str(result) |
275 | 270 | # Test query_tap raised errors |
276 | | - # DALOverflowWarning exists since pyvo 1.4 |
277 | | - if version.parse(pyvo_version) > version.parse('1.4'): |
278 | | - with pytest.raises(DALOverflowWarning, match="Partial result set *"): |
279 | | - truncated_result = Simbad.query_tap("SELECT * from basic", maxrec=2) |
280 | | - assert len(truncated_result) == 2 |
| 271 | + with pytest.raises(DALOverflowWarning, match="Partial result set *"): |
| 272 | + truncated_result = Simbad.query_tap("SELECT * from basic", maxrec=2) |
| 273 | + assert len(truncated_result) == 2 |
281 | 274 | with pytest.raises(ValueError, match="The maximum number of records cannot exceed 2000000."): |
282 | 275 | Simbad.query_tap("select top 5 * from basic", maxrec=10e10) |
283 | 276 | with pytest.raises(ValueError, match="Query string contains an odd number of single quotes.*"): |
|
0 commit comments