2 new revisions:

Revision: b25e2afe8d0f
Branch:   default
Author:   Pekka Klärck
Date:     Wed May 29 06:45:57 2013
Log: new run: fixed Pass Execution (except for verifying failures setting t...
http://code.google.com/p/robotframework/source/detail?r=b25e2afe8d0f

Revision: 8774a7f58491
Branch:   default
Author:   Pekka Klärck
Date:     Wed May 29 06:46:00 2013
Log:      Automated merge with https://code.google.com/p/robotframework/
http://code.google.com/p/robotframework/source/detail?r=8774a7f58491

==============================================================================
Revision: b25e2afe8d0f
Branch:   default
Author:   Pekka Klärck
Date:     Wed May 29 06:45:57 2013
Log: new run: fixed Pass Execution (except for verifying failures setting tags in suite teardown)
http://code.google.com/p/robotframework/source/detail?r=b25e2afe8d0f

Modified:
 /atest/robot/running/pass_execution.txt
 /atest/testdata/running/pass_execution.txt
 /src/robot/new_running/runner.py
 /src/robot/new_running/status.py

=======================================
--- /atest/robot/running/pass_execution.txt     Tue May 28 01:20:22 2013
+++ /atest/robot/running/pass_execution.txt     Wed May 29 06:45:57 2013
@@ -80,7 +80,6 @@

 With continuable failure in FOR loop
     ${tc}=    Check Test Case    ${TESTNAME}
-    Log    ${tc.kws[0].status}
     Should Be True    '${tc.kws[0].status}' == 'FAIL'
     Should Be True    '${tc.kws[0].kws[0].status}' == 'FAIL'
     Should Be True    '${tc.kws[0].kws[0].kws[0].status}' == 'FAIL'
@@ -102,7 +101,7 @@
 With test case teardown
     ${tc}=    Check Test Case    ${TESTNAME}
     Should Be True    '${tc.teardown.status}' == 'PASS'
-    Check Log Message    ${tc.teardown.msgs[0]}    ${PREFIX}message
+ Check Log Message ${tc.teardown.msgs[0]} ${PREFIX}This message is NOT used.

 If test case teardown fails
     ${tc}=    Check Test Case    ${TESTNAME}
=======================================
--- /atest/testdata/running/pass_execution.txt  Tue May 28 01:20:22 2013
+++ /atest/testdata/running/pass_execution.txt  Wed May 29 06:45:57 2013
@@ -116,17 +116,14 @@
     Fail    this should not be executed

 With test case teardown
-    [Documentation]    FAIL message
-    [Teardown]    Pass Execution    message
-    Fail    Teardown should succeed
+    [Documentation]    FAIL This message is used.
+    Fail    This message is used.
+    [Teardown]    Pass Execution    This message is NOT used.

 If test case teardown fails
-    [Documentation]    FAIL    message
-    ...
-    ...                Also teardown failed:
-    ...                failure
-    [Teardown]    Fail    failure
-    Pass Execution    message
+    [Documentation]    FAIL Teardown failed:\nThis message is used.
+    Pass Execution    This message is NOT used.
+    [Teardown]    Fail    This message is used.

 Modifying tags in test case teardown should succeed
     [Documentation]    PASS message
=======================================
--- /src/robot/new_running/runner.py    Wed May 29 05:38:42 2013
+++ /src/robot/new_running/runner.py    Wed May 29 06:45:57 2013
@@ -23,7 +23,7 @@
 from robot.running.context import EXECUTION_CONTEXTS
 from robot.running.keywords import Keywords, Keyword
 from robot.running.userkeyword import UserLibrary
-from robot.errors import ExecutionFailed, DataError
+from robot.errors import ExecutionFailed, DataError, PassExecution
 from robot import utils

 from .status import SuiteStatus, TestStatus
@@ -115,17 +115,23 @@
status.test_failed('Test case name cannot be empty.', test.critical)
         if not keywords:
status.test_failed('Test case contains no keywords.', test.critical)
-        self._run_setup(test.keywords.setup, status)
+        self._run_setup(test.keywords.setup, status, result)
         try:
             if not status.failures:
                 keywords.run(self._context)
+        except PassExecution, exception:
+            err = exception.earlier_failures
+            if err:
+                status.test_failed(err, test.critical)
+            else:
+                result.message = exception.message
         except ExecutionFailed, err:
             status.test_failed(err, test.critical)
         result.status = status.status
         result.message = status.message or result.message
         if status.teardown_allowed:
self._context.set_test_status_before_teardown(status.message, status.status) # TODO: This is fugly
-            self._run_teardown(test.keywords.teardown, status)
+            self._run_teardown(test.keywords.teardown, status, result)
         result.status = status.status
         result.message = status.message or result.message
         result.endtime = utils.get_timestamp()
@@ -139,15 +145,19 @@
         timeout.start()
         return timeout

-    def _run_setup(self, setup, status):
+    def _run_setup(self, setup, status, result=None):
         if not status.failures:
             failure = self._run_setup_or_teardown(setup, 'setup')
             status.setup_executed(failure)
+            if result and isinstance(failure, PassExecution):
+                result.message = failure.message

-    def _run_teardown(self, teardown, status):
+    def _run_teardown(self, teardown, status, result=None):
         if status.teardown_allowed:
             failure = self._run_setup_or_teardown(teardown, 'teardown')
             status.teardown_executed(failure)
+            if result and isinstance(failure, PassExecution):
+                result.message = failure.message
             return failure

     def _run_setup_or_teardown(self, data, type):
=======================================
--- /src/robot/new_running/status.py    Wed May 29 06:10:08 2013
+++ /src/robot/new_running/status.py    Wed May 29 06:45:57 2013
@@ -12,6 +12,8 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.

+from robot.errors import PassExecution
+

 class _ExecutionStatus(object):

@@ -26,13 +28,13 @@
self.skip_teardown_on_exit_mode = parent.skip_teardown_on_exit_mode if parent else False

     def setup_executed(self, failure=None):
-        if failure:
+        if failure and not isinstance(failure, PassExecution):
             self.setup_failure = unicode(failure)
             self._handle_possible_fatal(failure)
         self._teardown_allowed = True

     def teardown_executed(self, failure=None):
-        if failure:
+        if failure and not isinstance(failure, PassExecution):
             self.teardown_failure = unicode(failure)
             self._handle_possible_fatal(failure)


==============================================================================
Revision: 8774a7f58491
Branch:   default
Author:   Pekka Klärck
Date:     Wed May 29 06:46:00 2013
Log:      Automated merge with https://code.google.com/p/robotframework/
http://code.google.com/p/robotframework/source/detail?r=8774a7f58491


--

--- 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.


Reply via email to