When unit tests that create output FITS files fail, the test cleanup code might try to delete nonexisting files, causing other errors that are unrelated to what's actually failing in the test.
Instead of using the cleanup function, we can use a pytest tmp_path fixture to write files to a pytest temporary directory.
When unit tests that create output FITS files fail, the test cleanup code might try to delete nonexisting files, causing other errors that are unrelated to what's actually failing in the test.
Instead of using the cleanup function, we can use a pytest
tmp_path
fixture to write files to a pytest temporary directory.From their tutorial: