Skip to content

Commit

Permalink
Use context manager to ensure file closure
Browse files Browse the repository at this point in the history
  • Loading branch information
BSchilperoort committed Jul 26, 2024
1 parent b0908b2 commit f09e2d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_datasets/test_fapar_lai.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ def ingest_lai():
f = c.submit(ingest_lai)
f.result()

ds = xr.open_mfdataset((ingest_dir / "fapar-lai").glob("*.nc"))
assert isinstance(ds, xr.Dataset)
with xr.open_mfdataset((ingest_dir / "fapar-lai").glob("*.nc")) as ds:
assert isinstance(ds, xr.Dataset)

def test_load(self):
"""Test load function."""
Expand Down

0 comments on commit f09e2d7

Please sign in to comment.