@@ -0,0 +1,523 @@
+import pytest%0Afrom astropy.io import fits%0Aimport numpy as np%0Afrom pathlib import Path%0A%0Adef test_fitsdiff_openfile(tmpdir):%0A    %22%22%22Make sure that failing FITSDiff doesn't leave open files%22%22%22%0A    path1 = str(tmpdir.join(%22file1.fits%22))%0A    path2 = str(tmpdir.join(%22file2.fits%22))%0A%0A    hdulist = fits.HDUList(%5Bfits.PrimaryHDU(), fits.ImageHDU(data=np.zeros((10)))%5D)%0A    hdulist.writeto(path1)%0A    hdulist%5B1%5D.data%5B0%5D = 1%0A    hdulist.writeto(path2)%0A%0A    diff = fits.FITSDiff(path1, path2)%0A    assert diff.identical, diff.report()%0A

Add test showing --open-files error when FITSDiff raises AssertionError