Skip to content

Commit d4f8603

Browse files
committed
TST: import workaround for older pyvo versions
1 parent 23f9c6f commit d4f8603

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

astroquery/alma/tests/test_alma_remote.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
from astropy import units as u
1111
import numpy as np
1212
import pytest
13-
from pyvo.dal.exceptions import DALOverflowWarning
13+
try:
14+
# This requires pyvo 1.4
15+
from pyvo.dal.exceptions import DALOverflowWarning
16+
except ImportError:
17+
pass
1418

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

0 commit comments

Comments
 (0)