From 0f8a2b07a4bb235c1dd3aff4ad53ee8a083d67d0 Mon Sep 17 00:00:00 2001 From: Tom Krizek Date: Tue, 9 May 2023 14:20:02 +0200 Subject: [PATCH] Tear down module logger handler in system tests The module-level logger has a handler that writes into a temporary directory. Ensure the logging output is flushed and the handler is closed before attempting to remove this temporary directory. --- bin/tests/system/conftest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/tests/system/conftest.py b/bin/tests/system/conftest.py index 83a0130511..efcc2f51ff 100644 --- a/bin/tests/system/conftest.py +++ b/bin/tests/system/conftest.py @@ -449,6 +449,8 @@ else: ) else: mlogger.debug("deleting temporary directory") + handler.flush() + handler.close() shutil.rmtree(testdir) def _run_script( # pylint: disable=too-many-arguments