From 72e2a53436bf25405c086f09851e9e593618b8ec Mon Sep 17 00:00:00 2001 From: jmv74211 Date: Tue, 8 Feb 2022 10:53:18 +0100 Subject: [PATCH] refac: Truncate logs in the setup of truncate_log_files fixture #2460 --- tests/integration/conftest.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 4981e75ff3..5256a53071 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -883,14 +883,17 @@ def set_wazuh_configuration(configuration): @pytest.fixture(scope='function') def truncate_log_files(): - """Truncate all the log files after the test execution""" - yield - + """Truncate all the log files before and after the test execution""" log_files = [LOG_FILE_PATH] for log_file in log_files: truncate_file(log_file) + yield + + for log_file in log_files: + truncate_file(log_file) + def set_system(system): """Update the agent system in the global DB.