Revision: 4eec7fd6c7de
Branch:   default
Author:   Jussi Malinen <[email protected]>
Date:     Thu May 30 08:46:01 2013
Log:      set timeout occured -flag to context
http://code.google.com/p/robotframework/source/detail?r=4eec7fd6c7de

Modified:
 /src/robot/libraries/BuiltIn.py
 /src/robot/new_running/runner.py
 /src/robot/running/context.py

=======================================
--- /src/robot/libraries/BuiltIn.py     Wed May 29 10:05:27 2013
+++ /src/robot/libraries/BuiltIn.py     Thu May 30 08:46:01 2013
@@ -1496,7 +1496,7 @@
         Available in Robot Framework 2.5 and newer.
         """
test = self._get_test_in_teardown('Run Keyword If Timeout Occurred')
-        if test.timeout and test.timeout.any_timeout_occurred():
+        if self._context.timeout_occured:
             return self.run_keyword(name, *args)

     def _get_test_in_teardown(self, kwname):
=======================================
--- /src/robot/new_running/runner.py    Thu May 30 07:00:23 2013
+++ /src/robot/new_running/runner.py    Thu May 30 08:46:01 2013
@@ -127,6 +127,7 @@
             else:
                 result.message = exception.message
         except ExecutionFailed, err:
+            self._context.set_timeout(err)
             status.test_failed(err, test.critical)
         result.status = status.status
         result.message = status.message or result.message
@@ -177,6 +178,7 @@
         try:
             kw.run(self._context)
         except ExecutionFailed, err:
+            self._context.set_timeout(err)
             return err


=======================================
--- /src/robot/running/context.py       Thu May 30 07:00:23 2013
+++ /src/robot/running/context.py       Thu May 30 08:46:01 2013
@@ -62,6 +62,7 @@
         self.suite_teardown = False
         self._in_keyword_teardown = 0
         self._started_keywords = 0
+        self.timeout_occured = False

     # TODO: Clean-up needed here ....

@@ -97,9 +98,13 @@
     def end_keyword_teardown(self):
         self._in_keyword_teardown -= 1

+    def set_timeout(self, err):
+        self.timeout_occured = bool(err.timeout)
+
     def end_test(self, test):
         self.namespace.end_test()
         self.set_prev_test_variables(test)
+        self.timeout_occured = False

     def end_suite(self, suite):
         self.copy_prev_test_vars_to_global()

--

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