Skip to content

Commit

Permalink
docs: add unit in error message
Browse files Browse the repository at this point in the history
  • Loading branch information
ManonMarchand committed Jan 29, 2025
1 parent dca9873 commit ed9d418
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion astroquery/xmatch/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
5 changes: 2 additions & 3 deletions astroquery/xmatch/tests/test_xmatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit ed9d418

Please sign in to comment.