Author: Amaury Forgeot d'Arc <[email protected]>
Branch: less-gettestobjspace
Changeset: r58633:ab670ceeeffe
Date: 2012-10-31 01:13 +0100
http://bitbucket.org/pypy/pypy/changeset/ab670ceeeffe/
Log: Fix many tests
diff --git a/pypy/interpreter/test/test_code.py
b/pypy/interpreter/test/test_code.py
--- a/pypy/interpreter/test/test_code.py
+++ b/pypy/interpreter/test/test_code.py
@@ -8,8 +8,8 @@
if filename[-3:] != '.py':
filename = filename[:-1]
- cls.w_file = space.wrap(filename)
- cls.w_CO_CONTAINSGLOBALS = space.wrap(consts.CO_CONTAINSGLOBALS)
+ cls.w_file = cls.space.wrap(filename)
+ cls.w_CO_CONTAINSGLOBALS = cls.space.wrap(consts.CO_CONTAINSGLOBALS)
def test_attributes(self):
def f(): pass
diff --git a/pypy/interpreter/test/test_zzpickle_and_slow.py
b/pypy/interpreter/test/test_zzpickle_and_slow.py
--- a/pypy/interpreter/test/test_zzpickle_and_slow.py
+++ b/pypy/interpreter/test/test_zzpickle_and_slow.py
@@ -13,7 +13,7 @@
if filename[-3:] != '.py':
filename = filename[:-1]
- cls.w_file = space.wrap(filename)
+ cls.w_file = cls.space.wrap(filename)
def test_inspect(self):
if not hasattr(len, 'func_code'):
diff --git a/pypy/module/_io/test/test_io.py b/pypy/module/_io/test/test_io.py
--- a/pypy/module/_io/test/test_io.py
+++ b/pypy/module/_io/test/test_io.py
@@ -5,7 +5,7 @@
class AppTestIoModule:
spaceconfig = dict(usemodules=['_io'])
-xo
+
def test_import(self):
import io
diff --git a/pypy/module/crypt/test/test_crypt.py
b/pypy/module/crypt/test/test_crypt.py
--- a/pypy/module/crypt/test/test_crypt.py
+++ b/pypy/module/crypt/test/test_crypt.py
@@ -1,7 +1,7 @@
class AppTestCrypt:
spaceconfig = dict(usemodules=['crypt'])
- def test_crypt(self):
+ def test_crypt(self):
import crypt
res = crypt.crypt("pass", "ab")
assert isinstance(res, str)
diff --git a/pypy/module/imp/test/test_import.py
b/pypy/module/imp/test/test_import.py
--- a/pypy/module/imp/test/test_import.py
+++ b/pypy/module/imp/test/test_import.py
@@ -5,7 +5,8 @@
import pypy.interpreter.pycode
from pypy.tool.udir import udir
from pypy.rlib import streamio
-from pypy.tool.option import make_config, make_objspace
+from pypy.tool.option import make_config
+from pypy.tool.pytest.objspace import maketestobjspace
import pytest
import sys, os
import tempfile, marshal
@@ -642,8 +643,8 @@
class TestAbi:
def test_abi_tag(self):
- space1 = make_objspace(make_config(None, soabi='TEST'))
- space2 = make_objspace(make_config(None, soabi=''))
+ space1 = maketestobjspace(make_config(None, soabi='TEST'))
+ space2 = maketestobjspace(make_config(None, soabi=''))
if sys.platform == 'win32':
assert importing.get_so_extension(space1) == '.TESTi.pyd'
assert importing.get_so_extension(space2) == '.pyd'
@@ -953,7 +954,7 @@
allspaces = [self.space]
for opcodename in self.space.config.objspace.opcodes.getpaths():
key = 'objspace.opcodes.' + opcodename
- space2 = make_objspace(make_config(None, **{key: True}))
+ space2 = maketestobjspace(make_config(None, **{key: True}))
allspaces.append(space2)
for space1 in allspaces:
for space2 in allspaces:
diff --git a/pypy/module/sys/test/test_sysmodule.py
b/pypy/module/sys/test/test_sysmodule.py
--- a/pypy/module/sys/test/test_sysmodule.py
+++ b/pypy/module/sys/test/test_sysmodule.py
@@ -126,7 +126,7 @@
class AppTestSysModulePortedFromCPython:
def setup_class(cls):
- cls.w_appdirect = cls.wrap(cls.runappdirect)
+ cls.w_appdirect = cls.space.wrap(cls.runappdirect)
def test_original_displayhook(self):
import sys, cStringIO, __builtin__
@@ -596,7 +596,7 @@
class AppTestSysExcInfoDirect:
def setup_method(self, meth):
- self.checking = not self.option.runappdirect
+ self.checking = not self.runappdirect
if self.checking:
self.seen = []
from pypy.module.sys import vm
diff --git a/pypy/module/test_lib_pypy/numpypy/test_numpy.py
b/pypy/module/test_lib_pypy/numpypy/test_numpy.py
--- a/pypy/module/test_lib_pypy/numpypy/test_numpy.py
+++ b/pypy/module/test_lib_pypy/numpypy/test_numpy.py
@@ -1,5 +1,5 @@
class AppTestNumpy:
- space_config = dict(usemodules=['micronumpy'])
+ spaceconfig = dict(usemodules=['micronumpy'])
def test_imports(self):
try:
diff --git a/pypy/objspace/std/test/test_proxy_internals.py
b/pypy/objspace/std/test/test_proxy_internals.py
--- a/pypy/objspace/std/test/test_proxy_internals.py
+++ b/pypy/objspace/std/test/test_proxy_internals.py
@@ -6,6 +6,9 @@
class AppProxy(object):
spaceconfig = {"objspace.std.withtproxy": True}
+ def setup_class(cls):
+ pass # So that subclasses can call the super method.
+
def setup_method(self, meth):
self.w_get_proxy = self.space.appexec([], """():
class Controller(object):
diff --git a/pypy/objspace/std/test/test_strsliceobject.py
b/pypy/objspace/std/test/test_strsliceobject.py
--- a/pypy/objspace/std/test/test_strsliceobject.py
+++ b/pypy/objspace/std/test/test_strsliceobject.py
@@ -5,7 +5,7 @@
from pypy.objspace.std.strsliceobject import W_StringSliceObject
class AppTestStringObject(test_stringobject.AppTestStringObject):
- space_config = {"objspace.std.withstrslice": True}
+ spaceconfig = {"objspace.std.withstrslice": True}
def setup_class(cls):
def not_forced(space, w_s):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit