mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
functional: ensure log handlers are closed
This avoids a resource leak warning from python when the log handler is garbage collected. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20250715143023.1851000-9-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
committed by
Thomas Huth
parent
99c6e970a4
commit
069a2ce8a7
@@ -232,6 +232,7 @@ class QemuBaseTest(unittest.TestCase):
|
||||
self.socketdir = None
|
||||
self.machinelog.removeHandler(self._log_fh)
|
||||
self.log.removeHandler(self._log_fh)
|
||||
self._log_fh.close()
|
||||
|
||||
def main():
|
||||
path = os.path.basename(sys.argv[0])[:-3]
|
||||
@@ -399,4 +400,5 @@ class QemuSystemTest(QemuBaseTest):
|
||||
for vm in self._vms.values():
|
||||
vm.shutdown()
|
||||
logging.getLogger('console').removeHandler(self._console_log_fh)
|
||||
self._console_log_fh.close()
|
||||
super().tearDown()
|
||||
|
||||
Reference in New Issue
Block a user