Best Python code snippet using slash
app.py
Source:app.py
...24class Application(object):25 def __init__(self):26 super(Application, self).__init__()27 self._test_loader = Loader()28 self.set_report_stream(sys.stderr)29 self._argv = None30 self._reset_parser()31 self._positional_args = None32 self._parsed_args = None33 self._reporter = None34 self.test_loader = Loader()35 self.session = None36 self._working_directory = None37 self._interrupted = False38 self._exit_code = 039 self._prelude_warning_records = []40 def set_working_directory(self, path):41 self._working_directory = path42 @property43 def exit_code(self):44 return self._exit_code45 def set_exit_code(self, exit_code):46 self._exit_code = exit_code47 @property48 def interrupted(self):49 return self._interrupted50 @property51 def positional_args(self):52 return self._positional_args53 @property54 def parsed_args(self):55 return self._parsed_args56 def enable_interactive(self):57 self.arg_parser.add_argument(58 '-i', '--interactive', help='Enter an interactive shell',59 action="store_true", default=False)60 def _reset_parser(self):61 self.arg_parser = cli_utils.SlashArgumentParser()62 def set_argv(self, argv):63 self._argv = list(argv)64 def _get_argv(self):65 if self._argv is None:66 return sys.argv[1:]67 return self._argv[:]68 def set_report_stream(self, stream):69 if stream is not None:70 self._report_stream = stream71 self._default_reporter = ConsoleReporter(level=logbook.ERROR, stream=stream)72 self._console_handler = ConsoleHandler(stream=stream, level=logbook.ERROR)73 def set_reporter(self, reporter):74 self._reporter = reporter75 def get_reporter(self):76 returned = self._reporter77 if returned is None:78 returned = ConsoleReporter(79 level=config.root.log.console_level,80 stream=self._report_stream)81 return returned82 def __enter__(self):...
slash_run.py
Source:slash_run.py
...24 app.arg_parser.set_positional_metavar('TEST')25 if working_directory is not None:26 app.set_working_directory(working_directory)27 app.set_argv(args.argv)28 app.set_report_stream(report_stream)29 app.enable_interactive()30 collected = []31 try:32 with app:33 if app_callback is not None:34 app_callback(app)35 try:36 with handling_exceptions():37 if is_parallel() and app.parsed_args.interactive:38 raise InteractiveParallelNotAllowed("Cannot run interactive mode in parallel")39 if config.root.tmux.enabled and not is_child():40 _logger.notice("About to start slash in new tmux session...")41 run_slash_in_tmux(args)42 if is_parent():...
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!!