Skip to content

Commit

Permalink
Move check for path inside fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
vg3095 committed Aug 9, 2017
1 parent 700a5d9 commit 4e531df
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
5 changes: 5 additions & 0 deletions tardis/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ def tardis_ref_path():
def atomic_data_fname(tardis_ref_path):
atomic_data_fname = os.path.join(
tardis_ref_path, 'atom_data', 'kurucz_cd23_chianti_H_He.h5')

assert os.path.exists(atomic_data_fname), ("{0} atomic datafiles"
" does not seem to "
"exist".format(
atomic_data_fname))
return atomic_data_fname


Expand Down
4 changes: 0 additions & 4 deletions tardis/plasma/tests/test_plasmas_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ class TestPlasmas():
@classmethod
@pytest.fixture(scope="class", autouse=True)
def setup(self, atomic_data_fname):
assert os.path.exists(atomic_data_fname), ("{0} atomic datafiles"
" does not seem to "
"exist".format(
atomic_data_fname))
self.config_yaml = yaml_load_config_file(
'tardis/plasma/tests/data/plasma_test_config_lte.yml')
self.config_yaml['atom_data'] = atomic_data_fname
Expand Down
4 changes: 0 additions & 4 deletions tardis/tests/test_atomic.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,6 @@ def test_atomic_symbol_reverse():


def test_atomic_reprepare(atomic_data_fname):
assert os.path.exists(atomic_data_fname), ("{0} atomic datafiles "
"does not seem to "
"exist".format(
atomic_data_fname))
atom_data = atomic.AtomData.from_hdf5(atomic_data_fname)
atom_data.prepare_atom_data([14])
assert len(atom_data.lines) > 0
Expand Down
4 changes: 0 additions & 4 deletions tardis/tests/test_tardis_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ class TestSimpleRun():
@classmethod
@pytest.fixture(scope="class", autouse=True)
def setup(self, atomic_data_fname):
assert os.path.exists(atomic_data_fname), ("{0} atomic datafiles"
" does not seem to "
"exist".format(
atomic_data_fname))
self.config_yaml = yaml_load_config_file(
'tardis/io/tests/data/tardis_configv1_verysimple.yml')
self.config_yaml['atom_data'] = atomic_data_fname
Expand Down

0 comments on commit 4e531df

Please sign in to comment.