Revision: 3545
Author: janne.t.harkonen
Date: Wed May 26 04:50:18 2010
Log: Take copies of container values before passing them to listeners
http://code.google.com/p/robotframework/source/detail?r=3545

Modified:
 /trunk/src/robot/output/listeners.py

=======================================
--- /trunk/src/robot/output/listeners.py        Mon Mar 29 01:16:58 2010
+++ /trunk/src/robot/output/listeners.py        Wed May 26 04:50:18 2010
@@ -143,12 +143,19 @@
         mapping.update(dict([(n, n) for n in names]))
         attrs = {}
         for name, attr in mapping.items():
-            attr = getattr(item, attr)
-            if callable(attr):
-                attr = attr()
-            attrs[name] = attr
+            attrs[name] = self._get_attr_value(item, attr)
         return attrs

+    def _get_attr_value(self, item, attr_name):
+        attr = getattr(item, attr_name)
+        if callable(attr):
+            attr = attr()
+        if isinstance(attr, (utils.NormalizedDict, dict)):
+            attr = dict(attr)
+        if isinstance(attr, list):
+            attr = list(attr)
+        return attr
+

 class _ListenerProxy(AbstractLoggerProxy):
     _methods = ['start_suite', 'end_suite', 'start_test', 'end_test',

Reply via email to