3
3
import shutil
4
4
import numpy as np
5
5
import pytest
6
- import warnings
6
+
7
7
from datetime import datetime
8
8
import os
9
9
from urllib .parse import urlparse
@@ -40,7 +40,7 @@ def alma(request):
40
40
"""
41
41
alma = Alma ()
42
42
alma_site = request .config .getoption ('--alma-site' ,
43
- 'almascience.org' )
43
+ 'almascience.eso. org' )
44
44
alma .archive_url = 'https://{}' .format (alma_site )
45
45
return alma
46
46
@@ -85,9 +85,6 @@ def test_freq(self, alma):
85
85
assert row ['frequency' ] <= 100
86
86
assert '3' in row ['band_list' ]
87
87
88
- @pytest .mark .skipif ("SKIP_SLOW" ,
89
- reason = "Extremely slow due to limitations of "
90
- "the implementation" )
91
88
def test_bands (self , alma ):
92
89
payload = {'band_list' : ['5' , '7' ]}
93
90
result = alma .query (payload )
@@ -116,14 +113,14 @@ def test_alma_source_name(self, alma):
116
113
for row in result :
117
114
assert 'GRB021004' == row ['target_name' ]
118
115
119
- @pytest .mark .skipif ("SKIP_SLOW" , reason = "Known issue" )
120
116
def test_ra_dec (self , alma ):
121
117
payload = {'ra_dec' : '181.0192d -0.01928d' }
122
118
result = alma .query (payload )
123
119
assert len (result ) > 0
124
120
125
121
@pytest .mark .skipif ("SKIP_SLOW" )
126
122
def test_m83 (self , temp_dir , alma ):
123
+ # Runs for over 9 minutes
127
124
alma .cache_location = temp_dir
128
125
129
126
m83_data = alma .query_object ('M83' , science = True , legacy_columns = True )
@@ -205,6 +202,8 @@ def test_download_data(self, temp_dir, alma):
205
202
assert len (results ) == len (urls )
206
203
207
204
def test_download_and_extract (self , temp_dir , alma ):
205
+ # TODO: slowish, runs for ~90s
206
+
208
207
alma .cache_location = temp_dir
209
208
alma ._cycle0_tarfile_content_table = {'ID' : '' }
210
209
@@ -247,7 +246,6 @@ def test_download_and_extract(self, temp_dir, alma):
247
246
'cache_path/' + asdm_url .split ('/' )[- 1 ])
248
247
assert downloaded_asdm == [os .path .join (temp_dir , 'foo.py' )]
249
248
250
- @pytest .mark .skipif ("SKIP_SLOW" , reason = "Known issue" )
251
249
def test_doc_example (self , temp_dir , alma ):
252
250
alma .cache_location = temp_dir
253
251
m83_data = alma .query_object ('M83' , legacy_columns = True )
@@ -304,7 +302,7 @@ def test_query(self, temp_dir, alma):
304
302
# science=True)
305
303
# assert len(result) == 1
306
304
307
- @pytest .mark .skipif ( "SKIP_SLOW" , reason = "ra dec search known issue" )
305
+ @pytest .mark .xfail ( reason = "ra dec search known issue" )
308
306
def test_misc (self , alma ):
309
307
# miscellaneous set of common tests
310
308
#
@@ -367,7 +365,6 @@ def test_misc(self, alma):
367
365
assert '6' == row ['band_list' ]
368
366
assert 'ginsburg' in row ['obs_creator_name' ].lower ()
369
367
370
- @pytest .mark .skipif ("SKIP_SLOW" )
371
368
def test_user (self , alma ):
372
369
# miscellaneous set of tests from current users
373
370
rslt = alma .query ({'band_list' : [6 ], 'project_code' : '2012.1.*' },
@@ -380,7 +377,6 @@ def test_user(self, alma):
380
377
# This has been reported, as it is definitely a bug.
381
378
@pytest .mark .xfail
382
379
@pytest .mark .bigdata
383
- @pytest .mark .skipif ("SKIP_SLOW" )
384
380
def test_cycle1 (self , temp_dir , alma ):
385
381
# About 500 MB
386
382
alma .cache_location = temp_dir
@@ -427,7 +423,7 @@ def test_cycle1(self, temp_dir, alma):
427
423
assert len (data ) == 6
428
424
429
425
@pytest .mark .skipif ("SKIP_SLOW" )
430
- @pytest .mark .skip ( "Not working anymore" )
426
+ @pytest .mark .xfail ( reason = "Not working anymore" )
431
427
def test_cycle0 (self , temp_dir , alma ):
432
428
# About 20 MB
433
429
alma .cache_location = temp_dir
0 commit comments