Skip to content

Commit 4261455

Browse files
committed
Adding regression test for large query_crossid
1 parent 4730759 commit 4261455

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

astroquery/sdss/tests/test_sdss_remote.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from numpy.testing import assert_allclose
44
import pytest
55

6-
from astropy import coordinates
6+
from astropy.coordinates import SkyCoord
77
from astropy.table import Table
88

99
from urllib.error import URLError
@@ -18,9 +18,14 @@
1818
@pytest.mark.remote_data
1919
class TestSDSSRemote:
2020
# Test Case: A Seyfert 1 galaxy
21-
coords = coordinates.SkyCoord('0h8m05.63s +14d50m23.3s')
21+
coords = SkyCoord('0h8m05.63s +14d50m23.3s')
2222
mintimeout = 1e-2
2323

24+
# Large list of objects for regression tests
25+
query_large = "select top 1000 z, ra, dec, bestObjID from specObj where class = 'galaxy' and programname = 'eboss'"
26+
results_large = sdss.SDSS.query_sql(query_large)
27+
coords_large = SkyCoord(ra=results_large['ra'], dec=results_large['dec'], unit='deg')
28+
2429
def test_images_timeout(self):
2530
"""
2631
This test *must* be run before `test_sdss_image` because that query
@@ -191,3 +196,9 @@ def test_spectro_query_crossid(self, dr):
191196

192197
assert isinstance(query2, Table)
193198
assert query2['specObjID'][0] == query2['specObjID'][1] == query1['specObjID'][0]
199+
200+
def test_large_crossid(self):
201+
# Regression test for #589
202+
203+
results = sdss.SDSS.query_crossid(self.coords_large)
204+
assert len(results) == 894

0 commit comments

Comments
 (0)