Open
Description
In PR #1773 it was noticed that resulted in pytest.PytestUnraisableExceptionWarning:Exception ignored in: <_io.FileIO [closed]>
warnings from opening files like
Line 427 in b091985
which can be avoid by using a context manager to properly close the file like
Lines 424 to 425 in c2c2891
If this is implemented everywhere in the tests, then the warning ignore of
Line 85 in c2c2891
can be removed.