Skip to content

Commit a769979

Browse files
committed
Ignore DALOverflowWarning in tests
1 parent 94c2b38 commit a769979

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

astroquery/eso/tests/test_eso_remote.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343

4444
@pytest.mark.remote_data
4545
class TestEso:
46+
@pytest.mark.filterwarnings("ignore::pyvo.dal.exceptions.DALOverflowWarning")
4647
def test_query_tap_service(self):
4748
eso = Eso()
4849
eso.ROW_LIMIT = 7
@@ -53,6 +54,7 @@ def test_query_tap_service(self):
5354
assert len(t) > 0, "Table length is zero"
5455
assert len(t) == eso.ROW_LIMIT, f"Table length is {lt}, expected {eso.ROW_LIMIT}"
5556

57+
@pytest.mark.filterwarnings("ignore::pyvo.dal.exceptions.DALOverflowWarning")
5658
def test_row_limit(self):
5759
eso = Eso()
5860
eso.ROW_LIMIT = 5
@@ -73,6 +75,7 @@ def test_row_limit(self):
7375
n = len(table)
7476
assert n == eso.ROW_LIMIT, f"Expected {eso.ROW_LIMIT}; Obtained {n}"
7577

78+
@pytest.mark.filterwarnings("ignore::pyvo.dal.exceptions.DALOverflowWarning")
7679
def test_top(self):
7780
eso = Eso()
7881
top = 5
@@ -91,6 +94,7 @@ def test_top(self):
9194
n = len(table)
9295
assert n == top, f"Expected {top}; Obtained {n}"
9396

97+
@pytest.mark.filterwarnings("ignore::pyvo.dal.exceptions.DALOverflowWarning")
9498
def test_SgrAstar(self):
9599
eso = Eso()
96100
eso.ROW_LIMIT = 1
@@ -130,6 +134,7 @@ def test_SgrAstar(self):
130134
assert 'target_name' in result_s.colnames
131135
assert 'b319' in result_s['target_name']
132136

137+
@pytest.mark.filterwarnings("ignore::pyvo.dal.exceptions.DALOverflowWarning")
133138
def test_multicollection(self, tmp_path):
134139

135140
eso = Eso()
@@ -151,6 +156,7 @@ def test_multicollection(self, tmp_path):
151156
for tc in test_collections:
152157
assert counts[tc] > 0, f"{tc} : collection not present in results"
153158

159+
@pytest.mark.filterwarnings("ignore::pyvo.dal.exceptions.DALOverflowWarning")
154160
def test_empty_return(self):
155161
# test for empty return with an object from the North
156162
eso = Eso()
@@ -164,6 +170,7 @@ def test_empty_return(self):
164170

165171
assert len(result_s) == 0
166172

173+
@pytest.mark.filterwarnings("ignore::pyvo.dal.exceptions.DALOverflowWarning")
167174
def test_SgrAstar_remotevslocal(self, tmp_path):
168175
eso = Eso()
169176
# TODO originally it was 'gravity', but it is not yet ready in the TAP ISTs
@@ -236,6 +243,7 @@ def test_apex_retrieval(self):
236243

237244
assert np.all(tbl == tblb)
238245

246+
@pytest.mark.filterwarnings("ignore::pyvo.dal.exceptions.DALOverflowWarning")
239247
def test_each_instrument_SgrAstar(self, tmp_path):
240248
eso = Eso()
241249
eso.cache_location = tmp_path
@@ -272,6 +280,7 @@ def test_each_instrument_SgrAstar(self, tmp_path):
272280
assert result is not None, f"query_instrument({instrument}) returned None"
273281
assert len(result) > 0, f"query_instrument({instrument}) returned no records"
274282

283+
@pytest.mark.filterwarnings("ignore::pyvo.dal.exceptions.DALOverflowWarning")
275284
def test_each_collection_and_SgrAstar(self, tmp_path):
276285
eso = Eso()
277286
eso.cache_location = tmp_path
@@ -301,6 +310,7 @@ def test_each_collection_and_SgrAstar(self, tmp_path):
301310
assert len(generic_result) > 0, \
302311
f"query_collection({collection}) returned no records"
303312

313+
@pytest.mark.filterwarnings("ignore::pyvo.dal.exceptions.DALOverflowWarning")
304314
def test_mixed_case_instrument(self, tmp_path):
305315
eso = Eso()
306316
eso.cache_location = tmp_path
@@ -314,6 +324,7 @@ def test_mixed_case_instrument(self, tmp_path):
314324

315325
assert all(result1.values_equal(result2))
316326

327+
@pytest.mark.filterwarnings("ignore::pyvo.dal.exceptions.DALOverflowWarning")
317328
def test_main_SgrAstar(self):
318329
eso = Eso()
319330
eso.ROW_LIMIT = 5

setup.cfg

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ filterwarnings =
8787
ignore:The upstream SHA API has been changed:UserWarning
8888
# CDMS triggers this, but we don't use it directly
8989
ignore: The 'strip_cdata' option of HTMLParser:DeprecationWarning
90-
# TAP triggers DALOverflowWarning when the maxrec of the queries is set
91-
ignore:Partial result set:pyvo.dal.exceptions.DALOverflowWarning
9290

9391
markers =
9492
bigdata: marks tests that are expected to trigger a large download (deselect with '-m "not bigdata"')

0 commit comments

Comments
 (0)