diff --git a/astroquery/alma/tests/test_alma_remote.py b/astroquery/alma/tests/test_alma_remote.py index 743a8f702b..e641f23ae6 100644 --- a/astroquery/alma/tests/test_alma_remote.py +++ b/astroquery/alma/tests/test_alma_remote.py @@ -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 @@ -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) @@ -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)