Revision: 2080
Author: pekka.klarck
Date: Wed Jul 29 01:28:10 2009
Log: Fixed the bug that Set Global Variable keyword does not update parent suites (issue 315)
http://code.google.com/p/robotframework/source/detail?r=2080

Modified:
 /trunk/src/robot/running/__init__.py
 /trunk/src/robot/running/namespace.py

=======================================
--- /trunk/src/robot/running/__init__.py        Sun Apr 19 13:26:54 2009
+++ /trunk/src/robot/running/__init__.py        Wed Jul 29 01:28:10 2009
@@ -33,5 +33,10 @@
     def end_suite(self):
         self.current = self._namespaces.pop()

+    def __iter__(self):
+        namespaces = self._namespaces + [self.current]
+        return iter([ns for ns in namespaces if ns is not None])
+
+
 # Hook to namespaces
 NAMESPACES = _Namespaces()
=======================================
--- /trunk/src/robot/running/namespace.py       Sun Apr 19 13:26:54 2009
+++ /trunk/src/robot/running/namespace.py       Wed Jul 29 01:28:10 2009
@@ -336,7 +336,8 @@

     def set_global(self, name, value):
         GLOBAL_VARIABLES[name] = value
-        self.set_suite(name, value)
+        for ns in robot.running.NAMESPACES:
+            ns.variables.set_suite(name, value)

     def set_suite(self, name, value):
         self._suite[name] = value

Reply via email to