From 9988569beafce7f587f17a9ef710b76e9bfa3165 Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Wed, 11 Aug 2021 19:01:16 +0300 Subject: [PATCH] Tests: initialising log params before first _print_log(). --- test/conftest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/conftest.py b/test/conftest.py index ea3aaf72..4d46e2fc 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -400,6 +400,8 @@ def unit_run(): with open(temp_dir + '/unit.log', 'w') as log: unit_instance['process'] = subprocess.Popen(unitd_args, stderr=log) + Log.temp_dir = temp_dir + if not waitforfiles(temp_dir + '/control.unit.sock'): _print_log() exit('Could not start unit') @@ -409,7 +411,6 @@ def unit_run(): unit_instance['unitd'] = unitd option.temp_dir = temp_dir - Log.temp_dir = temp_dir with open(temp_dir + '/unit.pid', 'r') as f: unit_instance['pid'] = f.read().rstrip() @@ -487,7 +488,7 @@ def _check_alerts(*, log=None): print('skipped.') -def _print_log(log): +def _print_log(log=None): path = Log.get_path() print('Path to unit.log:\n' + path + '\n')