Best Python code snippet using avocado_python
job.py
Source:job.py
...81 #: The log directory for this job, also known as the job results82 #: directory. If it's set to None, it means that the job results83 #: directory has not yet been created.84 self.logdir = None85 self._setup_job_results()86 raw_log_level = settings.get_value('job.output', 'loglevel',87 default='debug')88 mapping = {'info': logging.INFO,89 'debug': logging.DEBUG,90 'warning': logging.WARNING,91 'error': logging.ERROR,92 'critical': logging.CRITICAL}93 if raw_log_level in mapping:94 self.loglevel = mapping[raw_log_level]95 else:96 self.loglevel = logging.DEBUG97 self.status = "RUNNING"98 self.result = result.Result(self)99 self.sysinfo = None100 self.timeout = getattr(self.args, 'job_timeout', 0)101 self.__logging_handlers = {}102 self.__start_job_logging()103 self.funcatexit = data_structures.CallbackRegister("JobExit %s"104 % self.unique_id,105 _TEST_LOGGER)106 self._stdout_stderr = None107 self.replay_sourcejob = getattr(self.args, 'replay_sourcejob', None)108 self.exitcode = exit_codes.AVOCADO_ALL_OK109 #: The list of discovered/resolved tests that will be attempted to110 #: be run by this job. If set to None, it means that test resolution111 #: has not been attempted. If set to an empty list, it means that no112 #: test was found during resolution.113 self.test_suite = None114 # A job may not have a dispatcher for pre/post tests execution plugins115 self._job_pre_post_dispatcher = None116 # The result events dispatcher is shared with the test runner.117 # Because of our goal to support using the phases of a job118 # freely, let's get the result events dispatcher ready early.119 # A future optimization may load it on demand.120 self._result_events_dispatcher = dispatcher.ResultEventsDispatcher(self.args)121 output.log_plugin_failures(self._result_events_dispatcher.load_failures)122 def _setup_job_results(self):123 """124 Prepares a job result directory, also known as logdir, for this job125 """126 logdir = getattr(self.args, 'logdir', None)127 if self.standalone:128 if logdir is not None:129 logdir = os.path.abspath(logdir)130 self.logdir = data_dir.create_job_logs_dir(logdir=logdir,131 unique_id=self.unique_id)132 else:133 self.logdir = tempfile.mkdtemp(prefix='avocado_' + __name__)134 else:135 if logdir is None:136 self.logdir = data_dir.create_job_logs_dir(unique_id=self.unique_id)...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!