def config_log(self): self._make(PROJ.LOG_DIR) if appOptions.log_level in self.sys_argv and \ self.option_args.pyauto_log_level != self.log_level: self.log_level = self.option_args.log_level if '--log-file' in self.pytest_args: self.log_file_set = True else: self.log_file_set = False Logger.init_logging( level=self.log_level, mode='rt', # log_path=str(PROJ.LOG_DIR/Path(f'app_{self.test_time}')) ) return self
def pytest_sessionstart(session): from app import Logger Logger.init_logging(log_path=session.config.getoption('--log-file'))