diff --git a/astroquery/xmatch/core.py b/astroquery/xmatch/core.py index 051f07a2f5..6dc1182cae 100644 --- a/astroquery/xmatch/core.py +++ b/astroquery/xmatch/core.py @@ -94,7 +94,7 @@ def query_async(self, cat1, cat2, max_distance, *, colRA1=None, colDec1=None, The HTTP response returned from the service. """ if max_distance > 180 * u.arcsec: - raise ValueError('max_distance argument must not be greater than 180') + raise ValueError('max_distance argument must not be greater than 180".') payload = {'request': 'xmatch', 'distMaxArcsec': max_distance.to(u.arcsec).value, 'RESPONSEFORMAT': 'votable', diff --git a/astroquery/xmatch/tests/test_xmatch.py b/astroquery/xmatch/tests/test_xmatch.py index 8c303516ac..72af37bf92 100644 --- a/astroquery/xmatch/tests/test_xmatch.py +++ b/astroquery/xmatch/tests/test_xmatch.py @@ -46,10 +46,9 @@ def request_mockreturn(method, url, data, **kwargs): def test_xmatch_query_invalid_max_distance(): - with pytest.raises(ValueError) as ex: + with pytest.raises(ValueError, + match='max_distance argument must not be greater than 180"'): XMatch().query_async('', '', 181 * arcsec) - assert str(ex.value) == ( - 'max_distance argument must not be greater than 180') def test_get_available_tables(monkeypatch):