Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kbwestfall committed Oct 30, 2024
1 parent 46ac2fe commit c97ec40
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pypeit/tests/test_mosaic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit c97ec40

Please sign in to comment.