33import os
44import urllib .request
55import warnings
6- from urllib .error import URLError
76
87import pytest
98import numpy as np
@@ -252,6 +251,7 @@ def test_no_auto_download(self):
252251 assert type (t ) is iers .IERS_B
253252
254253 @pytest .mark .remote_data
254+ @pytest .mark .xfail (reason = 'See issue 9600' )
255255 def test_simple (self ):
256256
257257 with iers .conf .set_temp ('iers_auto_url' , self .iers_a_url_1 ):
@@ -303,15 +303,11 @@ def test_simple(self):
303303
304304 # Look at times before and after the test file begins. This forces a new download.
305305 assert np .allclose (dat .ut1_utc (Time (50000 , format = 'mjd' ).jd ).value , 0.1292905 )
306- # https://github.com/astropy/astropy/issues/9600
307- with pytest .raises (ValueError ):
308- assert np .allclose (dat .ut1_utc (Time (60000 , format = 'mjd' ).jd ).value , - 0.3 )
306+ assert np .allclose (dat .ut1_utc (Time (60000 , format = 'mjd' ).jd ).value , - 0.3 )
309307
310308 # Now the time range should be different.
311309 assert dat ['MJD' ][0 ] == 57359.0 * u .d
312- # https://github.com/astropy/astropy/issues/9600 -- 60 becomes 48?
313- with pytest .raises (AssertionError ):
314- assert dat ['MJD' ][- 1 ] == (57539.0 + 60 ) * u .d
310+ assert dat ['MJD' ][- 1 ] == (57539.0 + 60 ) * u .d
315311
316312
317313@pytest .mark .remote_data
@@ -335,16 +331,22 @@ def test_IERS_B_parameters_loading_into_IERS_Auto():
335331 "correctly to IERS Auto" .format (name )))
336332
337333
334+ # Issue with FTP, rework test into previous one when it's fixed
335+ @pytest .mark .xfail ('TRAVIS' )
338336@pytest .mark .remote_data
339- @ pytest . mark . parametrize ( 'url' , ( iers . IERS_A_URL , iers . IERS_A_URL_MIRROR ))
340- def test_iers_a_dl ( url ):
337+ def test_iers_a_dl ():
338+ iersa_tab = iers . IERS_A . open ( iers . IERS_A_URL , cache = False )
341339 try :
342- iersa_tab = iers .IERS_A .open (url , cache = False )
343- except URLError :
344- if os .environ .get ('TRAVIS' ) and url == iers .IERS_A_URL :
345- pytest .xfail ('FTP timed out on Travis CI' )
346- else :
347- raise
340+ # some basic checks to ensure the format makes sense
341+ assert len (iersa_tab ) > 0
342+ assert 'UT1_UTC_A' in iersa_tab .colnames
343+ finally :
344+ iers .IERS_A .close ()
345+
346+
347+ @pytest .mark .remote_data
348+ def test_iers_a_dl_mirror ():
349+ iersa_tab = iers .IERS_A .open (iers .IERS_A_URL_MIRROR , cache = False )
348350 try :
349351 # some basic checks to ensure the format makes sense
350352 assert len (iersa_tab ) > 0
0 commit comments