Skip to content

Commit

Permalink
Try to fix on Windows with delete tag
Browse files Browse the repository at this point in the history
  • Loading branch information
rhugonnet committed Feb 2, 2023
1 parent 641af37 commit a83d6b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_coreg.py
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,7 @@ def test_dem_coregistration() -> None:
assert dem_coreg2 == dem_coreg

# Test saving to file (mode = "w" is necessary to work on Windows)
outfile = tempfile.NamedTemporaryFile(suffix=".tif", mode="w")
outfile = tempfile.NamedTemporaryFile(suffix=".tif", mode="w", delete=False)
xdem.coreg.dem_coregistration(tba_dem, ref_dem, out_dem_path=outfile.name)
dem_coreg2 = xdem.DEM(outfile.name)
assert dem_coreg2 == dem_coreg
Expand All @@ -1257,7 +1257,7 @@ def test_dem_coregistration() -> None:
assert np.all(~inlier_mask[gl_mask])

# Testing with plot
out_fig = tempfile.NamedTemporaryFile(suffix=".png", mode="w")
out_fig = tempfile.NamedTemporaryFile(suffix=".png", mode="w", delete=False)
assert os.path.getsize(out_fig.name) == 0
xdem.coreg.dem_coregistration(tba_dem, ref_dem, plot=True, out_fig=out_fig.name)
assert os.path.getsize(out_fig.name) > 0
Expand Down

0 comments on commit a83d6b1

Please sign in to comment.