2 new revisions:
Revision: 42b239d57ecf
Branch: default
Author: jussi.ao.malinen
Date: Wed May 29 06:03:50 2013
Log: new run: handle fatal exceptions
http://code.google.com/p/robotframework/source/detail?r=42b239d57ecf
Revision: 629bbe6e78de
Branch: default
Author: jussi.ao.malinen
Date: Wed May 29 06:03:59 2013
Log: Automated merge with https://code.google.com/p/robotframework/
http://code.google.com/p/robotframework/source/detail?r=629bbe6e78de
==============================================================================
Revision: 42b239d57ecf
Branch: default
Author: jussi.ao.malinen
Date: Wed May 29 06:03:50 2013
Log: new run: handle fatal exceptions
http://code.google.com/p/robotframework/source/detail?r=42b239d57ecf
Modified:
/atest/testdata/running/fatal_exception_suite_setup/01__suite_setup.txt
/src/robot/new_running/status.py
=======================================
--- /atest/testdata/running/fatal_exception_suite_setup/01__suite_setup.txt
Mon May 27 14:27:12 2013
+++ /atest/testdata/running/fatal_exception_suite_setup/01__suite_setup.txt
Wed May 29 06:03:50 2013
@@ -5,6 +5,5 @@
*** Test Cases ***
Test That Should Not Be Run 1
- [Documentation] FAIL Parent suite setup failed:
- ... FatalCatastrophyException
+ [Documentation] FAIL Test execution is stopped due to a fatal error
Fail This should not be executed
=======================================
--- /src/robot/new_running/status.py Wed May 29 05:38:42 2013
+++ /src/robot/new_running/status.py Wed May 29 06:03:50 2013
@@ -22,20 +22,24 @@
self.teardown_failure = None
self._teardown_allowed = False
self.exiting_on_failure = parent.exiting_on_failure if parent else
False
+ self.exiting_on_fatal = parent.exiting_on_fatal if parent else
False
self.skip_teardown_on_exit_mode =
parent.skip_teardown_on_exit_mode if parent else False
def setup_executed(self, failure=None):
if failure:
self.setup_failure = unicode(failure)
+ self._handle_possible_fatal(failure)
self._teardown_allowed = True
def teardown_executed(self, failure=None):
if failure:
self.teardown_failure = unicode(failure)
+ self._handle_possible_fatal(failure)
@property
def teardown_allowed(self):
- if self.exiting_on_failure and self.skip_teardown_on_exit_mode:
+ if self.skip_teardown_on_exit_mode and (self.exiting_on_failure or
+ self.exiting_on_fatal):
return False
return self._teardown_allowed
@@ -50,7 +54,8 @@
return bool(self.setup_failure or
self.teardown_failure or
self.test_failure or
- self.exiting_on_failure)
+ self.exiting_on_failure or
+ self.exiting_on_fatal)
@property
def status(self):
@@ -70,6 +75,11 @@
def _parent_message(self):
return ParentMessage(self.parent).message
+ def _handle_possible_fatal(self, failure):
+ if getattr(failure, 'exit', False):
+ self.parent.fatal_failure()
+ self.exiting_on_fatal = True
+
class SuiteStatus(_ExecutionStatus):
@@ -85,6 +95,11 @@
if self.parent:
self.parent.critical_failure()
+ def fatal_failure(self):
+ self.exiting_on_fatal = True
+ if self.parent:
+ self.parent.fatal_failure()
+
def _my_message(self):
return SuiteMessage(self).message
@@ -98,7 +113,8 @@
self.test_failure = unicode(failure)
if critical:
self.parent.critical_failure()
- self.exiting_on_failure = self.parent.exiting_on_failure
+ self.exiting_on_failure = self.parent.exit_on_failure_mode
+ self._handle_possible_fatal(failure)
def _my_message(self):
return TestMessage(self).message
@@ -138,10 +154,12 @@
also_teardown_message = '%s\n\nAlso teardown failed:\n%s'
# TODO: Clean up error message below
exit_on_failure_message = 'Critical failure occurred and ExitOnFailure
option is in use'
+ exit_on_fatal_message = 'Test execution is stopped due to a fatal
error'
def __init__(self, status):
_Message.__init__(self, status)
self.exiting_on_failure = status.exiting_on_failure
+ self.exiting_on_fatal = status.exiting_on_fatal
@property
def message(self):
@@ -150,6 +168,8 @@
return message
if self.exiting_on_failure:
return self.exit_on_failure_message
+ if self.exiting_on_fatal:
+ return self.exit_on_fatal_message
return ''
==============================================================================
Revision: 629bbe6e78de
Branch: default
Author: jussi.ao.malinen
Date: Wed May 29 06:03:59 2013
Log: Automated merge with https://code.google.com/p/robotframework/
http://code.google.com/p/robotframework/source/detail?r=629bbe6e78de
--
---
You received this message because you are subscribed to the Google Groups "robotframework-commit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.