Skip to content

Commit d486762

Browse files
committed
review cleanup
1 parent da199cf commit d486762

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

atest/robot/cli/runner/status_rc.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Zero RC when all tests pass
1111
${EMPTY} ${PASSING} rc=0
1212
--statusrc ${PASSING} rc=0
1313

14-
Non-zero RC when ests fail
14+
Non-zero RC when tests fail
1515
${EMPTY} ${FAILING} rc=1
1616
-r report.html ${FAILING} rc=1
1717
-l log.html --statusrc ${FAILING} rc=1

src/robot/model/totalstatistics.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@ def visit(self, visitor):
3030
visitor.visit_total_statistics(self)
3131

3232
def __iter__(self):
33-
return iter([self.all])
33+
yield self.all
3434

3535
@property
3636
def message(self):
3737
"""String representation of the statistics.
3838
3939
For example::
40-
2 tests total, 1 passed, 1 failed
40+
2 tests, 1 passed, 1 failed
4141
"""
4242
test_or_task = 'test' if not self._rpa else 'task'
43-
atotal, aend, apass, afail = self._get_counts(self.all)
43+
total, end, passed, failed = self._get_counts(self.all)
4444
return ('%d %s%s, %d passed, %d failed'
45-
% (atotal, test_or_task, aend, apass, afail))
45+
% (total, test_or_task, end, passed, failed))
4646

4747
def _get_counts(self, stat):
4848
ending = 's' if stat.total != 1 else ''

src/robot/result/model.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ def passed(self):
148148
def passed(self, passed):
149149
self.status = 'PASS' if passed else 'FAIL'
150150

151+
@property
152+
def critical(self):
153+
warnigs.warn("'TestCase.criticality' has been deprecated and always "
154+
" returns 'True'.",
155+
UserWarning)
156+
return True
157+
151158

152159
class TestSuite(model.TestSuite):
153160
"""Represents results of a single test suite.

src/robot/running/runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def end_suite(self, suite):
9696
failure = self._run_teardown(suite.keywords.teardown, self._suite_status)
9797
if failure:
9898
self._suite.suite_teardown_failed(unic(failure))
99-
self._suite_status.critical_failure_occurred()
99+
self._suite_status.failure_occurred()
100100
self._suite.endtime = get_timestamp()
101101
self._suite.message = self._suite_status.message
102102
self._context.end_suite(ModelCombiner(suite, self._suite))
@@ -146,7 +146,7 @@ def visit_test(self, test):
146146
failure = self._run_teardown(test.keywords.teardown, status,
147147
result)
148148
if failure:
149-
status.critical_failure_occurred()
149+
status.failure_occurred()
150150
if not status.failures and result.timeout and result.timeout.timed_out():
151151
status.test_failed(result.timeout.get_message())
152152
result.message = status.message

src/robot/running/status.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def teardown_executed(self, failure=None):
8181
self.failure.teardown = unic(failure)
8282
self.exit.failure_occurred(failure)
8383

84-
def critical_failure_occurred(self):
84+
def failure_occurred(self):
8585
self.exit.failure_occurred()
8686

8787
def error_occurred(self):

0 commit comments

Comments
 (0)