summaryrefslogtreecommitdiffstats
path: root/src/testdir/test86.in
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-06-12 14:26:26 +0200
committerBram Moolenaar <Bram@vim.org>2013-06-12 14:26:26 +0200
commit27610ed76c500cf680fdbac000d269e30dcba54c (patch)
tree0adbfe3811b9f618eec2b361490c62e921731c26 /src/testdir/test86.in
parent9f3685a527c9293b05c8ad7a6a4a7c2fa8b3b8b8 (diff)
updated for version 7.3.1173v7.3.1173
Problem: Python 2 tests don't have the same output everywhere. Solution: Make the Python 2 tests more portable. (ZyX)
Diffstat (limited to 'src/testdir/test86.in')
-rw-r--r--src/testdir/test86.in19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/testdir/test86.in b/src/testdir/test86.in
index e22ae31039..a46a70ac32 100644
--- a/src/testdir/test86.in
+++ b/src/testdir/test86.in
@@ -45,9 +45,10 @@ d.update({'0': -1})
dk = d.keys()
dv = d.values()
di = d.items()
-dk.sort(key=repr)
-dv.sort(key=repr)
-di.sort(key=repr)
+cmpfun = lambda a, b: cmp(repr(a), repr(b))
+dk.sort(cmpfun)
+dv.sort(cmpfun)
+di.sort(cmpfun)
EOF
:$put =pyeval('d[''f''](self={})')
:$put =pyeval('repr(dk)')
@@ -813,7 +814,17 @@ def ee(expr, g=globals(), l=locals()):
try:
exec(expr, g, l)
except:
- cb.append(expr + ':' + repr(sys.exc_info()[:2]))
+ ei = sys.exc_info()
+ msg = sys.exc_info()[0].__name__ + ':' + repr(sys.exc_info()[1].args)
+ msg = msg.replace('TypeError:(\'argument 1 ', 'TypeError:(\'')
+ if expr.find('None') > -1:
+ msg = msg.replace('TypeError:(\'iteration over non-sequence\',)',
+ 'TypeError:("\'NoneType\' object is not iterable",)')
+ if expr == 'fd(self=[])':
+ # HACK: PyMapping_Check changed meaning
+ msg = msg.replace('AttributeError:(\'keys\',)',
+ 'TypeError:(\'unable to convert object to vim dictionary\',)')
+ cb.append(expr + ':' + msg)
else:
cb.append(expr + ':NOT FAILED')
d = vim.Dictionary()