How to use _get_previous_summary method in stestr

Best Python code snippet using stestr_python

__init__.py

Source:__init__.py Github

copy

Full Screen

...165 self.ui = ui166 self.get_id = get_id167 self._previous_run = previous_run168 self._summary = SummarizingResult()169 def _get_previous_summary(self):170 if self._previous_run is None:171 return None172 previous_summary = SummarizingResult()173 previous_summary.startTestRun()174 test = self._previous_run.get_test()175 test.run(previous_summary)176 previous_summary.stopTestRun()177 return previous_summary178 def _output_summary(self, run_id):179 """Output a test run.180 :param run_id: The run id.181 """182 if self.ui.options.quiet:183 return184 time = self._summary.get_time_taken()185 time_delta = None186 num_tests_run_delta = None187 num_failures_delta = None188 values = [('id', run_id, None)]189 failures = self._summary.get_num_failures()190 previous_summary = self._get_previous_summary()191 if failures:192 if previous_summary:193 num_failures_delta = failures - previous_summary.get_num_failures()194 values.append(('failures', failures, num_failures_delta))195 if previous_summary:196 num_tests_run_delta = self._summary.testsRun - previous_summary.testsRun197 if time:198 previous_time_taken = previous_summary.get_time_taken()199 if previous_time_taken:200 time_delta = time - previous_time_taken201 skips = len(self._summary.skipped)202 if skips:203 values.append(('skips', skips, None))204 self.ui.output_summary(...

Full Screen

Full Screen

results.py

Source:results.py Github

copy

Full Screen

...96 *(self._summary.errors[-1]),97 test_tags=test_tags))98 if test_status not in self.filterable_states:99 return100 def _get_previous_summary(self):101 if self._previous_run is None:102 return None103 previous_summary = SummarizingResult()104 previous_summary.startTestRun()105 test = self._previous_run.get_test()106 test.run(previous_summary)107 previous_summary.stopTestRun()108 return previous_summary109 def _output_summary(self, run_id):110 """Output a test run.111 :param run_id: The run id.112 """113 time = self._summary.get_time_taken()114 time_delta = None115 num_tests_run_delta = None116 num_failures_delta = None117 values = [('id', run_id, None)]118 failures = self._summary.get_num_failures()119 previous_summary = self._get_previous_summary()120 if failures:121 if previous_summary:122 num_failures_delta = failures - \123 previous_summary.get_num_failures()124 values.append(('failures', failures, num_failures_delta))125 if previous_summary:126 num_tests_run_delta = self._summary.testsRun - \127 previous_summary.testsRun128 if time:129 previous_time_taken = previous_summary.get_time_taken()130 if previous_time_taken:131 time_delta = time - previous_time_taken132 skips = len(self._summary.skipped)133 if skips:...

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run stestr automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful