[pypy-commit] pypy py3k: Fix most -A tests in module/zipimport
amauryfa
noreply at buildbot.pypy.org
Tue Feb 19 09:26:37 CET 2013
Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: py3k
Changeset: r61441:1040bdcae4a0
Date: 2013-02-19 08:48 +0100
http://bitbucket.org/pypy/pypy/changeset/1040bdcae4a0/
Log: Fix most -A tests in module/zipimport
diff --git a/pypy/module/zipimport/test/test_zipimport.py b/pypy/module/zipimport/test/test_zipimport.py
--- a/pypy/module/zipimport/test/test_zipimport.py
+++ b/pypy/module/zipimport/test/test_zipimport.py
@@ -74,9 +74,10 @@
w_cache = space.getattr(space.getbuiltinmodule('zipimport'),
space.wrap('_zip_directory_cache'))
space.call_function(space.getattr(w_cache, space.wrap('clear')))
- self.w_modules = space.call_method(
+ self.w_modules = space.call_function(
+ space.w_list,
space.getattr(space.getbuiltinmodule('sys'),
- space.wrap('modules')), 'copy')
+ space.wrap('modules')))
def teardown_method(self, meth):
space = self.space
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
@@ -88,7 +88,7 @@
elif isinstance(value, unicode):
# python2 unicode -> python3 string
defs.append("self.%s = %s\n" % (symbol, repr(value)[1:]))
- elif isinstance(value, (int, float, list)):
+ elif isinstance(value, (int, float, list, dict)):
defs.append("self.%s = %r\n" % (symbol, value))
source = py.code.Source(target_)[1:]
pyfile = udir.join('src.py')
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
@@ -71,7 +71,7 @@
py.test.skip("cannot runappdirect test: space needs %s = %s, "\
"while pypy-c was built with %s" % (key, value, has))
- for name in ('int', 'long', 'str', 'unicode', 'None', 'ValueError',
+ for name in ('int', 'long', 'str', 'unicode', 'list', 'None', 'ValueError',
'OverflowError'):
setattr(self, 'w_' + name, eval(name))
import __builtin__ as __builtin__
@@ -100,6 +100,9 @@
def str_w(self, w_str):
return w_str
+ def bytes_w(self, w_bytes):
+ return w_bytes
+
def newdict(self, module=None):
return {}
More information about the pypy-commit
mailing list