Commits

Amaury Forgeot d'Arc committed 1040bdc

Fix most -A tests in module/zipimport

Comments (0)

Files changed (3)

pypy/module/zipimport/test/test_zipimport.py

         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

pypy/tool/pytest/apptest.py

         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')

pypy/tool/pytest/objspace.py

                 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__
     def str_w(self, w_str):
         return w_str
 
+    def bytes_w(self, w_bytes):
+        return w_bytes
+
     def newdict(self, module=None):
         return {}