From c97ec40cfc190fae451ab7b7b684dabed9b8ca1d Mon Sep 17 00:00:00 2001 From: Kyle Westfall Date: Tue, 29 Oct 2024 17:15:42 -0700 Subject: [PATCH] test fix --- pypeit/tests/test_mosaic.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pypeit/tests/test_mosaic.py b/pypeit/tests/test_mosaic.py index b50649bb0..9079be992 100644 --- a/pypeit/tests/test_mosaic.py +++ b/pypeit/tests/test_mosaic.py @@ -24,17 +24,18 @@ def test_io(): _mpar = Mosaic.from_file(ofile) # Change the version + _ofile = data_output_path('tmp_mosaic_wrongver.fits') with fits.open(ofile) as hdu: hdu['MOSAIC'].header['DMODVER'] = '1.0.0' - hdu.writeto(ofile, overwrite=True) + hdu.writeto(_ofile, overwrite=True) # Reading should fail because version is checked by default with pytest.raises(PypeItDataModelError): - _mpar = Mosaic.from_file(ofile) + _mpar = Mosaic.from_file(_ofile) # Should not fail because skipping the version check - _mpar = Mosaic.from_file(ofile, chk_version=False) + _mpar = Mosaic.from_file(_ofile, chk_version=False) - # Remove file - ofile = Path(ofile) - ofile.unlink() + # Remove files + Path(ofile).unlink() + Path(_ofile).unlink()