Skip to content

Commit

Permalink
Reset back to working dir after test
Browse files Browse the repository at this point in the history
Reset back to working dir after test
  • Loading branch information
sstendahl committed Aug 30, 2023
1 parent 9acce71 commit 0dad997
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hogben/tests/test_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ def test_main_function(_mock_save_plot):
Tests whether the main function runs properly and creates a figure for
all defined model types.
"""
work_dir = os.getcwd()
with tempfile.TemporaryDirectory() as temp_dir:
# Results are saved in parent folder, so need to create a temporary
# child, as we don't have access to the parent of the temp folder
Expand All @@ -314,3 +315,4 @@ def test_main_function(_mock_save_plot):
sld_profile = os.path.join('results', subfolder, 'sld_profile.png')
assert os.path.isfile(reflectivity_profile)
assert os.path.isfile(sld_profile)
os.chdir(work_dir)

0 comments on commit 0dad997

Please sign in to comment.