Explicitly close files opened by selftest
authorJeremy Stanley <fungi@yuggoth.org>
Sat, 19 Sep 2020 14:32:11 +0000 (14:32 +0000)
committerJeremy Stanley <fungi@yuggoth.org>
Sat, 19 Sep 2020 14:32:11 +0000 (14:32 +0000)
commited9b25ba4a86c6e969d35f053b69ae2ed5b1990f
tree094978aa10b6af6676b77ec0cd7bf2c228bce6be
parentba5be370d4031c5f925a33b39e5f480ef256ada3
Explicitly close files opened by selftest

Newer Python interpreters emit a warning during cleanup if open
files are not closed prior to termination. Our selftest opens the
pidfile for reading in a couple of places, as well as logfiles to
capture stdout/stderr. Open them in context blocks so they will be
closed on return rather than remaining open until the process ends.
mudpy/tests/selftest.py