Use context managers in tests to avoid pytest.PytestUnraisableExceptionWarning:Exception ignored in: <_io.FileIO [closed]> #1776
Labels
chore
Other changes that don't modify src or test files
help wanted
Extra attention is needed / contributions welcome
tests
pytest
In PR #1773 it was noticed that resulted in
pytest.PytestUnraisableExceptionWarning:Exception ignored in: <_io.FileIO [closed]>
warnings from opening files likepyhf/tests/test_export.py
Line 427 in b091985
which can be avoid by using a context manager to properly close the file like
pyhf/tests/test_export.py
Lines 424 to 425 in c2c2891
If this is implemented everywhere in the tests, then the warning ignore of
pyhf/pyproject.toml
Line 85 in c2c2891
can be removed.
The text was updated successfully, but these errors were encountered: