Best Python code snippet using lemoncheesecake
run.py
Source:run.py
...44 elif "LCC_REPORTING" in os.environ:45 try:46 return do_get_reporting_backend_names(47 project.default_reporting_backend_names,48 parse_reporting_backend_names_expression(os.environ["LCC_REPORTING"])49 )50 except ValueError as e:51 raise LemoncheesecakeException("Invalid $LCC_REPORTING: %s" % e)52 else:53 return project.default_reporting_backend_names54def create_report_dir(cli_args, project):55 report_dir = cli_args.report_dir or os.environ.get("LCC_REPORT_DIR")56 if report_dir:57 try:58 os.mkdir(report_dir)59 except OSError as e:60 return LemoncheesecakeException("Cannot create report directory: %s" % e)61 else:62 try:...
behave.py
Source:behave.py
...47 if "LCC_REPORTING" in os.environ:48 try:49 reporting_backend_names = get_reporting_backend_names(50 _DEFAULT_REPORTING_BACKENDS,51 parse_reporting_backend_names_expression(os.environ["LCC_REPORTING"])52 )53 except ValueError as e:54 raise Exception("Invalid $LCC_REPORTING: %s" % e)55 else:56 reporting_backend_names = _DEFAULT_REPORTING_BACKENDS57 reporting_backends = get_reporting_backends_for_test_run(58 {b.get_name(): b for b in get_reporting_backends()}, reporting_backend_names59 )60 return Session.create(SyncEventManager.load(), reporting_backends, report_dir, report_saving_strategy)61class _Hooks(object):62 def __init__(self, top_dir):63 self.top_dir = top_dir64 self.session = None65 @staticmethod...
backend.py
Source:backend.py
...85 raise ValueError(86 "either the custom reporting backends must be fixed backend list, "87 "or a list of turn on/off (+ / ^) directives"88 )89def parse_reporting_backend_names_expression(expr):90 return list(filter(bool, expr.split(" ")))91def get_reporting_backend_by_name(name):92 try:93 return next(backend for backend in get_reporting_backends() if backend.get_name() == name)94 except StopIteration:95 raise KeyError()96def get_reporting_backends_for_test_run(available_backends, backend_names):97 backends = []98 for backend_name in backend_names:99 try:100 backend = available_backends[backend_name]101 except KeyError:102 raise LemoncheesecakeException("Unknown reporting backend '%s'" % backend_name)103 if not isinstance(backend, ReportingSessionBuilderMixin):...
test_report_backend.py
Source:test_report_backend.py
...74 get_reporting_backend_names(("console", "html", "json"), ("console", "+junit"))75def test_reporting_fixed_invalid_turn_off():76 with pytest.raises(ValueError):77 get_reporting_backend_names(("console", "html", "json"), ("^unknown",))78def test_parse_reporting_backend_names_expression():...
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!!