Skip to content

Commit

Permalink
test: add try/except for DALOverflowWarning
Browse files Browse the repository at this point in the history
  • Loading branch information
ManonMarchand committed Oct 20, 2023
1 parent 7769e25 commit 3cfe840
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion astroquery/simbad/tests/test_simbad_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
# Maybe we need to expose SimbadVOTableResult to be in the public API?
from astroquery.simbad.core import SimbadVOTableResult
from astroquery.exceptions import BlankResponseWarning
from pyvo.dal import DALOverflowWarning
try:
# This requires pyvo 1.4.2
from pyvo.dal.exceptions import DALOverflowWarning
except ImportError:
pass


# M42 coordinates
Expand Down Expand Up @@ -267,6 +271,7 @@ def test_query_tap(self):
expect = "letters numbers\n------- -------\n a 1\n b 2\n c 3"
assert expect == str(result)
# Test query_tap raised errors
# DALOverflowWarning exists since pyvo 1.4.2
with pytest.raises(DALOverflowWarning, match="Partial result set *"):
truncated_result = Simbad.query_tap("SELECT * from basic", maxrec=2)
assert len(truncated_result) == 2
Expand Down

0 comments on commit 3cfe840

Please sign in to comment.