Skip to content

Commit

Permalink
Fix filehandle left open
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamJamieson committed Nov 16, 2023
1 parent 728014f commit baf2523
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/test_stnode.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,17 +254,19 @@ def test_nuke_validation(nuke_env_var, tmp_path):

# Read broken files with datamodel object
with context:
datamodels.WfiImgPhotomRefModel(broken_save)
dm = datamodels.WfiImgPhotomRefModel(broken_save)
dm.close()
with context:
datamodels.WfiImgPhotomRefModel(broken_to_asdf)
dm = datamodels.WfiImgPhotomRefModel(broken_to_asdf)
dm.close()

# True to read broken files with rdm.open
with context:
with datamodels.open(broken_save):
pass
with datamodels.open(broken_save) as dm:
dm.close()
with context:
with datamodels.open(broken_to_asdf):
pass
with datamodels.open(broken_to_asdf) as dm:
dm.close()


@pytest.mark.parametrize("nuke_env_strict_var", VALIDATION_CASES, indirect=True)
Expand Down

0 comments on commit baf2523

Please sign in to comment.