Best Python code snippet using avocado_python
job.py
Source:job.py
...342 paths = ', '.join([x.path for x in tpl])343 job_log.info('Variant %s: %s', index + 1, paths)344 if mux.variants:345 job_log.info('')346 def _log_job_debug_info(self, mux):347 """348 Log relevant debug information to the job log.349 """350 self._log_cmdline()351 self._log_avocado_version()352 self._log_avocado_config()353 self._log_avocado_datadir()354 self._log_mux_tree(mux)355 self._log_tmp_dir()356 self._log_mux_variants(mux)357 self._log_job_id()358 def create_test_suite(self):359 """360 Creates the test suite for this Job361 This is a public Job API as part of the documented Job phases362 """363 try:364 self.test_suite = self._make_test_suite(self.references)365 self.result.tests_total = len(self.test_suite)366 except loader.LoaderError as details:367 stacktrace.log_exc_info(sys.exc_info(), 'avocado.app.debug')368 raise exceptions.OptionValidationError(details)369 if not self.test_suite:370 if self.references:371 references = " ".join(self.references)372 e_msg = ("No tests found for given test references, try "373 "'avocado list -V %s' for details" % references)374 else:375 e_msg = ("No test references provided nor any other arguments "376 "resolved into tests. Please double check the executed"377 " command.")378 raise exceptions.OptionValidationError(e_msg)379 def pre_tests(self):380 """381 Run the pre tests execution hooks382 By default this runs the plugins that implement the383 :class:`avocado.core.plugin_interfaces.JobPre` interface.384 """385 self._job_pre_post_dispatcher = dispatcher.JobPrePostDispatcher()386 output.log_plugin_failures(self._job_pre_post_dispatcher.load_failures)387 self._job_pre_post_dispatcher.map_method('pre', self)388 self._result_events_dispatcher.map_method('pre_tests', self)389 def run_tests(self):390 mux = getattr(self.args, "mux", None)391 if mux is None:392 mux = multiplexer.Mux()393 if not mux.is_parsed(): # Mux not yet parsed, apply args394 try:395 mux.parse(self.args)396 except (IOError, ValueError) as details:397 raise exceptions.OptionValidationError("Unable to parse mux: "398 "%s" % details)399 self._make_test_runner()400 self._start_sysinfo()401 self._log_job_debug_info(mux)402 jobdata.record(self.args, self.logdir, mux, self.references, sys.argv)403 replay_map = getattr(self.args, 'replay_map', None)404 summary = self.test_runner.run_suite(self.test_suite,405 mux,406 self.timeout,407 replay_map)408 # If it's all good so far, set job status to 'PASS'409 if self.status == 'RUNNING':410 self.status = 'PASS'411 _TEST_LOGGER.info('Test results available in %s', self.logdir)412 if summary is None:413 self.exitcode |= exit_codes.AVOCADO_JOB_FAIL414 return self.exitcode415 if 'INTERRUPTED' in summary:...
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!!