Make large coordinate list generation as a fixture to avoid remote_data access
@@ -21,10 +21,13 @@ class TestSDSSRemote:
coords = SkyCoord('0h8m05.63s +14d50m23.3s')
mintimeout = 1e-2
+ @pytest.fixture()
+ def large_results(self):
# 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')
+ 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):
"""
@@ -197,8 +200,8 @@ class TestSDSSRemote:
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
