close files in tests and before raising exception in get_open_msa_slits #7599
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
jwst downstream tests have been failing in stdatamodels because of numerous
pytest.PytestUnraisableExceptionWarning
warnings as a result ofResourceWarning
warnings from unclosed files.https://github.com/spacetelescope/stdatamodels/actions/runs/5215436542/jobs/9412973900
jwst does not currently convert these
PytestUnraisableExceptionWarning
warnings into errors but the warnings can be seen in the log files for CI runs:https://github.com/spacetelescope/jwst/actions/runs/5157043601/jobs/9288891837#step:10:169
The changes in this PR are mostly to tests to close opened files but also includes a minor change to
get_open_msa_slits
to close a file prior to raising an exception.This does not address all of the warnings as some are due to code in stdatamodels. A corresponding stdatmodels PR to fix those issues is:
spacetelescope/stdatamodels#169
and an example PR that sets the stdatamodels dependency to the source branch of the above stdatamodels PR is here (to
hopefullydemonstrate that all errors are addressed by the two PRs):#7601
the CI shows no more
PytestUnraisableExceptionWarning
warningshttps://github.com/spacetelescope/jwst/actions/runs/5225497772/jobs/9435044814
but does show 2 test failures:
which appear related to jwst not yet being up to date with the changes in Update of outlierpars file for IFU outlier detection stdatamodels#164
I don't believe the merging of this and the stdatamodels PR need to be coordinated as the changes in each are independent (but both address similar issues).
Checklist for maintainers
CHANGES.rst
within the relevant release sectionHow to run regression tests on a PR