Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r63357:3243312f9f03
Date: 2013-04-14 16:48 -0700
http://bitbucket.org/pypy/pypy/changeset/3243312f9f03/

Log:    better simulate the collection wrapping rules under appdirect tests

diff --git a/pypy/tool/pytest/objspace.py b/pypy/tool/pytest/objspace.py
--- a/pypy/tool/pytest/objspace.py
+++ b/pypy/tool/pytest/objspace.py
@@ -88,6 +88,13 @@
     def wrap(self, obj):
         if isinstance(obj, str):
             return obj.decode('utf-8')
+        if isinstance(obj, dict):
+            return dict((self.wrap(k), self.wrap(v))
+                        for k, v in obj.iteritems())
+        if isinstance(obj, tuple):
+            return tuple(self.wrap(item) for item in obj)
+        if isinstance(obj, list):
+            return list(self.wrap(item) for item in obj)
         return obj
 
     def wrapbytes(self, obj):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to