3737
3838download_hostname = 'almascience.eso.org'
3939
40+ # The MAXREC related overflow message is different in pyvo 1.7+, remove workaround when we have it as a minimum
41+ overflow_message = r"Partial result set. Potential causes MAXREC|Result set limited by user- or server-supplied MAXREC"
42+
4043
4144@pytest .fixture
4245def alma (request ):
@@ -56,14 +59,12 @@ def alma(request):
5659@pytest .mark .remote_data
5760class TestAlma :
5861 def test_public (self , alma ):
59- with pytest .warns (expected_warning = DALOverflowWarning ,
60- match = "Partial result set. Potential causes MAXREC, async storage space, etc." ):
62+ with pytest .warns (expected_warning = DALOverflowWarning , match = overflow_message ):
6163 results = alma .query (payload = None , public = True , maxrec = 100 )
6264 assert len (results ) == 100
6365 for row in results :
6466 assert row ['data_rights' ] == 'Public'
65- with pytest .warns (expected_warning = DALOverflowWarning ,
66- match = "Partial result set. Potential causes MAXREC, async storage space, etc." ):
67+ with pytest .warns (expected_warning = DALOverflowWarning , match = overflow_message ):
6768 results = alma .query (payload = None , public = False , maxrec = 100 )
6869 assert len (results ) == 100
6970 for row in results :
@@ -105,8 +106,7 @@ def test_freq(self, alma):
105106 def test_bands (self , alma ):
106107 payload = {'band_list' : ['5' , '7' ]}
107108 # Added maxrec here as downloading and reading the results take too long.
108- with pytest .warns (expected_warning = DALOverflowWarning ,
109- match = "Partial result set. Potential causes MAXREC, async storage space, etc." ):
109+ with pytest .warns (expected_warning = DALOverflowWarning , match = overflow_message ):
110110 result = alma .query (payload , maxrec = 1000 )
111111 assert len (result ) > 0
112112 for row in result :
@@ -342,8 +342,7 @@ def test_misc(self, alma):
342342
343343 result = alma .query_object ('M83' , public = True , science = True )
344344 assert len (result ) > 0
345- with pytest .warns (expected_warning = DALOverflowWarning ,
346- match = "Partial result set. Potential causes MAXREC, async storage space, etc." ):
345+ with pytest .warns (expected_warning = DALOverflowWarning , match = overflow_message ):
347346 result = alma .query (payload = {'pi_name' : 'Bally*' }, public = True ,
348347 maxrec = 10 )
349348 assert result
0 commit comments