Skip to content

Commit

Permalink
close netcdf file before reopening in test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew committed May 14, 2024
1 parent 2e779f5 commit 23bc8cf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/test_init_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,9 @@ def test_if_new_eta_fields_absent(self, patched, tmp_path: Path) -> None:
ckp_file_new.close()
shutil.move(ckp_path_new, ckp_path_old) # overwrite original npz

# close the netcdf file so can be safely opened in load
_delta.output_netcdf.close()

# load the file from path, and check that there is no eta0 present
checkpoint = np.load(ckp_path_old, allow_pickle=True)
checkpoint = dict(checkpoint)
Expand Down

0 comments on commit 23bc8cf

Please sign in to comment.