Skip to content

Commit

Permalink
Make large coordinate list generation as a fixture to avoid remote_da…
Browse files Browse the repository at this point in the history
…ta access
  • Loading branch information
bsipocz committed Feb 23, 2022
1 parent ac28f3e commit 9157024
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions astroquery/sdss/tests/test_sdss_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ class TestSDSSRemote:
coords = SkyCoord('0h8m05.63s +14d50m23.3s')
mintimeout = 1e-2

# Large list of objects for regression tests
query_large = "select top 1000 z, ra, dec, bestObjID from specObj where class = 'galaxy' and programname = 'eboss'"
results_large = sdss.SDSS.query_sql(query_large)
coords_large = SkyCoord(ra=results_large['ra'], dec=results_large['dec'], unit='deg')
@pytest.fixture()
def large_results(self):
# Large list of objects for regression tests
query = "select top 1000 z, ra, dec, bestObjID from specObj where class = 'galaxy' and programname = 'eboss'"
results = sdss.SDSS.query_sql(query)
coords_large = SkyCoord(ra=results['ra'], dec=results['dec'], unit='deg')
return coords_large

def test_images_timeout(self):
"""
Expand Down Expand Up @@ -197,8 +200,8 @@ def test_spectro_query_crossid(self, dr):
assert isinstance(query2, Table)
assert query2['specObjID'][0] == query2['specObjID'][1] == query1['specObjID'][0]

def test_large_crossid(self):
def test_large_crossid(self, large_results):
# Regression test for #589

results = sdss.SDSS.query_crossid(self.coords_large)
results = sdss.SDSS.query_crossid(large_results)
assert len(results) == 894

0 comments on commit 9157024

Please sign in to comment.