Skip to content

Commit

Permalink
TST: import workaround for older pyvo versions
Browse files Browse the repository at this point in the history
  • Loading branch information
bsipocz committed Nov 16, 2022
1 parent 23f9c6f commit d4f8603
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion astroquery/alma/tests/test_alma_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
from astropy import units as u
import numpy as np
import pytest
from pyvo.dal.exceptions import DALOverflowWarning
try:
# This requires pyvo 1.4
from pyvo.dal.exceptions import DALOverflowWarning
except ImportError:
pass

from astroquery.exceptions import CorruptDataWarning
from astroquery.utils.commons import ASTROPY_LT_4_1
Expand Down Expand Up @@ -49,6 +53,7 @@ def alma(request):
@pytest.mark.remote_data
class TestAlma:
def test_public(self, alma):
# This warning was added in pyvo 1.4, but we don't test older versions with remote-data
with pytest.warns(expected_warning=DALOverflowWarning,
match="Partial result set. Potential causes MAXREC, async storage space, etc."):
results = alma.query(payload=None, public=True, maxrec=100)
Expand Down Expand Up @@ -84,6 +89,7 @@ def test_freq(self, alma):
def test_bands(self, alma):
payload = {'band_list': ['5', '7']}
# Added maxrec here as downloading and reading the results take too long.
# This warning was added in pyvo 1.4, but we don't test older versions with remote-data
with pytest.warns(expected_warning=DALOverflowWarning,
match="Partial result set. Potential causes MAXREC, async storage space, etc."):
result = alma.query(payload, maxrec=1000)
Expand Down

0 comments on commit d4f8603

Please sign in to comment.