Author: Amaury Forgeot d'Arc <[email protected]>
Branch: py3k
Changeset: r61430:31f7184f866f
Date: 2013-02-18 23:32 +0100
http://bitbucket.org/pypy/pypy/changeset/31f7184f866f/
Log: Fix most -A tests in module/imp
diff --git a/pypy/tool/pytest/apptest.py b/pypy/tool/pytest/apptest.py
--- a/pypy/tool/pytest/apptest.py
+++ b/pypy/tool/pytest/apptest.py
@@ -64,7 +64,15 @@
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
- args = ','.join(repr(arg) for arg in args)
+ arg_repr = []
+ for arg in args:
+ if isinstance(arg, str):
+ arg_repr.append("b%r" % arg)
+ elif isinstance(arg, unicode):
+ arg_repr.append(repr(arg)[1:])
+ else:
+ arg_repr.append(repr(arg))
+ args = ','.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit