Best Python code snippet using autotest_python
subcommand.py
Source:subcommand.py
...119 cls.join_hooks.append(hook)120 def redirect_output(self):121 if self.subdir and logging_manager_object:122 tag = os.path.basename(self.subdir)123 logging_manager_object.tee_redirect_debug_dir(self.debug, tag=tag)124 def fork_start(self):125 sys.stdout.flush()126 sys.stderr.flush()127 r, w = os.pipe()128 self.returncode = None129 self.pid = os.fork()130 if self.pid: # I am the parent131 os.close(w)132 self.result_pickle = os.fdopen(r, 'r')133 return134 else:135 os.close(r)136 # We are the child from this point on. Never return.137 signal.signal(signal.SIGTERM, signal.SIG_DFL) # clear handler...
xen.py
Source:xen.py
...27 if logfile == '':28 logfile = os.path.join(self.log_dir, 'xen_build')29 os.chdir(self.build_dir)30 self.log('log_dir: %s ' % self.log_dir)31 self.job.logging.tee_redirect_debug_dir(self.log_dir, log_name=logfile)32 # build xen hypervisor and user-space tools33 targets = ['xen', 'tools']34 threads = 2 * utils.count_cpus()35 for t in targets:36 build_string = 'make -j %d %s %s' % (threads, make_opts, t)37 self.log('build_string: %s' % build_string)38 utils.system(build_string)39 # make a kernel job out of the kernel from the xen src if one isn't provided40 if self.kjob is None:41 # get xen kernel tree ready42 self.log("prep-ing xen'ified kernel source tree")43 utils.system('make prep-kernels')44 v = self.get_xen_kernel_build_ver()45 self.log('building xen kernel version: %s' % v)...
client_logging_config.py
Source:client_logging_config.py
...8class ClientLoggingConfig(logging_config.LoggingConfig):9 """10 1.é¦å
è°ç¨super(ClientLoggingConfig, self).configure_loggingï¼çæ两个handleræåstdoutåstderr11 2.ç¶åå¦ææresult dirï¼è°ç¨add_debug_file_handlersï¼çæ4个filehandler,æåresultdir/debug/12 3.å¨test.pyä¸ä¼è°ç¨job.logging.tee_redirect_debug_dir(self.debugdir,log_name=self.tagged_testname)13 è¿æ¯managerçå½æ°ï¼ä¼å次è°ç¨å°add_debug_file_handlerså½æ°ï¼å¨debugdiréé¢éæ°å建4个filehandler14 """15 def add_debug_file_handlers(self, log_dir, log_name=None):16 #å¢å 4个handleræå4个级å«17 if not log_name:18 log_name = settings.get_value('CLIENT', 'default_logging_name',19 type=str, default='client')20 self._add_file_handlers_for_all_levels(log_dir, log_name)21 #è¿ä¸ªæ¹æ³å°å¯¹loggingè¿è¡é
ç½®ï¼job.pyä¸ä¼ å
¥çå¼ä¸ºï¼result_dir=self.resultdir22 #verbose=option.verbose23 def configure_logging(self, results_dir=None, verbose=False):24 super(ClientLoggingConfig, self).configure_logging(25 use_console=self.use_console,26 verbose=verbose)...
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!!