Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions astroquery/eso/tests/test_eso_remote.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import tempfile
import shutil
from astropy.tests.helper import pytest, remote_data
Expand All @@ -17,17 +16,19 @@

SKIP_TESTS = not(HAS_KEYRING and ESO_IMPORTED)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we at it, I wonder what is the reason to skip the test if the module is not importable (both here in the remote and in the local testing file). Sure, it cannot be imported when keyring is not available, but I think if something else go wrong it may hide undetected because of this try ... except.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we should skip tests only if keyring can't be imported.


instrument_list = [u'fors1', u'fors2', u'vimos', u'omegacam', u'hawki',
u'isaac', u'naco', u'visir', u'vircam', u'apex', u'uves',
u'giraffe', u'xshooter', u'muse', u'crires', u'kmos',
u'sinfoni', u'amber', u'midi', u'harps']
instrument_list = [u'fors1', u'fors2', u'sphere', u'vimos', u'omegacam',
u'hawki', u'isaac', u'naco', u'visir', u'vircam', u'apex',
u'uves', u'giraffe', u'xshooter', u'muse', u'crires',
u'kmos', u'sinfoni', u'amber', u'midi', u'harps']


@pytest.mark.skipif('SKIP_TESTS')
@remote_data
class TestEso:
@pytest.fixture()
def temp_dir(self, request):
my_temp_dir = tempfile.mkdtemp()

def fin():
shutil.rmtree(my_temp_dir)
request.addfinalizer(fin)
Expand Down Expand Up @@ -105,7 +106,7 @@ def test_list_instruments(self):
# data_files = eso.retrieve_data([data_product_id])
# # How do we know if we're going to get .fits or .fits.Z?
# assert 'AMBER.2006-03-14T07:40:03.741.fits' in data_files[0]

@pytest.mark.skipif('not Eso.USERNAME')
def test_retrieve_data(self):
eso = Eso()
Expand Down