Skip to content

Commit ed9d418

Browse files
committed
docs: add unit in error message
1 parent dca9873 commit ed9d418

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

astroquery/xmatch/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def query_async(self, cat1, cat2, max_distance, *, colRA1=None, colDec1=None,
9494
The HTTP response returned from the service.
9595
"""
9696
if max_distance > 180 * u.arcsec:
97-
raise ValueError('max_distance argument must not be greater than 180')
97+
raise ValueError('max_distance argument must not be greater than 180".')
9898
payload = {'request': 'xmatch',
9999
'distMaxArcsec': max_distance.to(u.arcsec).value,
100100
'RESPONSEFORMAT': 'votable',

astroquery/xmatch/tests/test_xmatch.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,9 @@ def request_mockreturn(method, url, data, **kwargs):
4646

4747

4848
def test_xmatch_query_invalid_max_distance():
49-
with pytest.raises(ValueError) as ex:
49+
with pytest.raises(ValueError,
50+
match='max_distance argument must not be greater than 180"'):
5051
XMatch().query_async('', '', 181 * arcsec)
51-
assert str(ex.value) == (
52-
'max_distance argument must not be greater than 180')
5352

5453

5554
def test_get_available_tables(monkeypatch):

0 commit comments

Comments
 (0)