@remote_data
def test_invalid_location_download():
 from ..data import download_file
 with pytest.raises(urllib.error.URLError):
  download_file(u'http://astropy.org/nonexistentfile')

@ remote_data def test_invalid_location_download ( ) : from . . data import download_file with pytest . raises ( urllib . error . URLError ) : download_file ( u'http://astropy.org/nonexistentfile' )
checks that download_file gives a urlerror and not an attributeerror .