Author: Amaury Forgeot d'Arc <[email protected]>
Branch: less-gettestobjspace
Changeset: r58622:b24bde921e50
Date: 2012-10-29 01:59 +0100
http://bitbucket.org/pypy/pypy/changeset/b24bde921e50/

Log:    progress

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
@@ -1,12 +1,9 @@
-from pypy.conftest import gettestobjspace
 from pypy.interpreter import gateway
 from pypy.interpreter.astcompiler import consts
 import py
 
 class AppTestCodeIntrospection:
     def setup_class(cls):
-        space = gettestobjspace()
-        cls.space = space
         filename = __file__
         if filename[-3:] != '.py':
             filename = filename[:-1]
diff --git a/pypy/interpreter/test/test_compiler.py 
b/pypy/interpreter/test/test_compiler.py
--- a/pypy/interpreter/test/test_compiler.py
+++ b/pypy/interpreter/test/test_compiler.py
@@ -4,7 +4,6 @@
 from pypy.interpreter.pycode import PyCode
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.argument import Arguments
-from pypy.conftest import gettestobjspace
 
 class BaseTestCompiler:
     def setup_method(self, method):
@@ -915,8 +914,7 @@
         assert "LOAD_GLOBAL" not in output
 
 class AppTestCallMethod(object):
-    def setup_class(cls):
-        cls.space = gettestobjspace(**{'objspace.opcodes.CALL_METHOD': True})
+    spaceconfig = {'objspace.opcodes.CALL_METHOD': True}
         
     def test_call_method_kwargs(self):
         source = """def _f(a):
diff --git a/pypy/interpreter/test/test_executioncontext.py 
b/pypy/interpreter/test/test_executioncontext.py
--- a/pypy/interpreter/test/test_executioncontext.py
+++ b/pypy/interpreter/test/test_executioncontext.py
@@ -1,17 +1,11 @@
 import py
 from pypy.interpreter import executioncontext
-from pypy.conftest import gettestobjspace, option
 
 class Finished(Exception):
     pass
 
 
 class TestExecutionContext:
-    keywords = {}
-
-    def setup_class(cls):
-        cls.space = gettestobjspace(**cls.keywords)
-
     def test_action(self):
 
         class DemoAction(executioncontext.AsyncAction):
@@ -260,13 +254,13 @@
 
 
 class TestExecutionContextWithCallMethod(TestExecutionContext):
-    keywords = {'objspace.opcodes.CALL_METHOD': True}
+    spaceconfig ={'objspace.opcodes.CALL_METHOD': True}
 
 
 class AppTestDelNotBlocked:
 
     def setup_method(self, meth):
-        if not option.runappdirect:
+        if not cls.option.runappdirect:
             py.test.skip("test is meant for running with py.test -A")
         from pypy.tool.udir import udir
         tmpfile = udir.join('test_execution_context')
diff --git a/pypy/interpreter/test/test_gateway.py 
b/pypy/interpreter/test/test_gateway.py
--- a/pypy/interpreter/test/test_gateway.py
+++ b/pypy/interpreter/test/test_gateway.py
@@ -1,7 +1,6 @@
 
 # -*- coding: utf-8 -*-
 
-from pypy.conftest import gettestobjspace
 from pypy.interpreter import gateway, argument
 from pypy.interpreter.gateway import ObjSpace, W_Root, WrappedDefault
 import py
@@ -715,12 +714,9 @@
         assert isinstance(called[0], argument.Arguments)
 
 class TestPassThroughArguments_CALL_METHOD(TestPassThroughArguments):
-
-    def setup_class(cls):
-        space = gettestobjspace(usemodules=('itertools',), **{
+    spaceconfig = dict(usemodules=('itertools',), **{
             "objspace.opcodes.CALL_METHOD": True
             })
-        cls.space = space
 
 class AppTestKeywordsToBuiltinSanity(object):
 
diff --git a/pypy/interpreter/test/test_syntax.py 
b/pypy/interpreter/test/test_syntax.py
--- a/pypy/interpreter/test/test_syntax.py
+++ b/pypy/interpreter/test/test_syntax.py
@@ -1,6 +1,5 @@
 from __future__ import with_statement
 import py
-from pypy.conftest import gettestobjspace
 
 def splitcases(s):
     lines = [line.rstrip() for line in s.split('\n')]
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
@@ -1,13 +1,10 @@
 import py
 from pypy import conftest
-from pypy.conftest import gettestobjspace
 from pypy.interpreter import gateway
 from pypy.rlib.jit import non_virtual_ref, vref_None
 
 class AppTestSlow:    
     def setup_class(cls):
-        space = gettestobjspace()
-        cls.space = space
         if py.test.config.option.runappdirect:
             filename = __file__
         else:
@@ -66,7 +63,7 @@
                   space.wrap('read_exc_type'),
                   space.wrap(read_exc_type_gw))
     
-def _detatch_helpers(space):
+def _detach_helpers(space):
     space.delitem(space.builtin.w_dict,
                   space.wrap('hide_top_frame'))
     space.delitem(space.builtin.w_dict,
@@ -74,12 +71,13 @@
 
 class AppTestInterpObjectPickling:
     pytestmark = py.test.mark.skipif("config.option.runappdirect")
+    spaceconfig = dict(usemodules=['struct'])
+
     def setup_class(cls):
-        cls.space = gettestobjspace(usemodules=['struct'])
         _attach_helpers(cls.space)
 
     def teardown_class(cls):
-        _detatch_helpers(cls.space)
+        _detach_helpers(cls.space)
 
     def test_pickle_code(self):
         def f():
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,8 +1,5 @@
-from pypy.conftest import gettestobjspace
-
 class AppTestNumpy:
-    def setup_class(cls):
-        cls.space = gettestobjspace(usemodules=['micronumpy'])
+    space_config = dict(usemodules=['micronumpy'])
 
     def test_imports(self):
         try:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to