Best Python code snippet using slash
console_reporter.py
Source:console_reporter.py  
...137        if not self._verobsity_allows(VERBOSITIES.WARNING):138            # for concise outputs we need to break the sequence of dots...139            self._terminal.write('\n')140        header_format = self._get_session_summary_header_format(session)141        for index, (test_index, test_result, infos) in enumerate(self._iter_reported_results(session)):142            if index == 0:143                self._terminal.sep('=', 'Session Summary', **header_format)144            self._report_test_summary_header(test_index, test_result)145            self._report_additional_test_details(test_result)146            for info_reporter in infos:147                info_reporter(test_result)148        if self._verobsity_allows(VERBOSITIES.WARNING):149            self._report_result_warning_summary(session)150        msg = 'Session ended.'151        msg += ' {} successful, {} skipped, {} failed, {} erroneous.'.format(152            session.results.get_num_successful(153            ), session.results.get_num_skipped(include_not_run=False),154            session.results.get_num_failures(), session.results.get_num_errors())155        not_run = session.results.get_num_not_run()156        if not_run:157            msg += ' {} not run.'.format(not_run)158        if (session.has_children() and session.parallel_manager.server159                and session.parallel_manager.server.worker_error_reported):160            msg += " Found session errors in children."161        msg += ' Total duration: {}'.format(162            self._format_duration(session.duration))163        self._terminal.sep('=', msg, **header_format)164    def _get_session_summary_header_format(self, session):165        if session.results.is_success(allow_skips=True):166            return theme('session-summary-success')167        return theme('session-summary-failure')168    def _iter_reported_results(self, session):169        for test_index, test_result in enumerate(session.results.iter_test_results()):170            infos = self._get_result_info_generators(test_result)171            if not infos:172                continue173            yield test_index, test_result, infos174    def _report_test_summary_header(self, index, test_result):175        self._terminal.lsep(176            "=", '== #{}: {}'.format(index + 1, test_result.test_metadata.address), **theme('test-error-header'))177    def _get_result_info_generators(self, test_result):178        returned = []179        if self._verobsity_allows(VERBOSITIES.ERROR) and test_result.has_errors_or_failures():180            returned.append(self._report_result_errors_failures)181        if self._verobsity_allows(VERBOSITIES.INFO) and test_result.has_skips():182            returned.append(self._report_result_skip_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!!
