Skip to content

Commit

Permalink
Always overwrite Reference data when regenerating
Browse files Browse the repository at this point in the history
  • Loading branch information
yeganer committed Aug 30, 2017
1 parent f956e07 commit 1483138
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tardis/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def tardis_ref_path():
@pytest.yield_fixture(scope="session")
def tardis_ref_data(tardis_ref_path, generate_reference):
if generate_reference:
mode = 'a'
mode = 'w'
else:
mode = 'r'
with pd.HDFStore(
Expand Down
13 changes: 10 additions & 3 deletions tardis/plasma/tests/test_complete_plasmas.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,16 @@ def config(self, request):
return config

@pytest.yield_fixture(scope="class")
def reference(self, reference_fpath):
with pd.HDFStore(reference_fpath) as hdf_file:
yield hdf_file
def reference(self, reference_fpath, generate_reference):
if generate_reference:
mode = 'w'
else:
mode = 'r'
with pd.HDFStore(
reference_fpath,
mode=mode
) as store:
yield store

@pytest.fixture(scope="class")
def plasma(self, chianti_he_db_fpath, config, reference_fpath, reference):
Expand Down

0 comments on commit 1483138

Please sign in to comment.