[pypy-commit] pypy less-gettestobjspace: progress

amauryfa noreply at buildbot.pypy.org
Mon Oct 29 22:40:16 CET 2012


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: less-gettestobjspace
Changeset: r58613:663521b4c7e8
Date: 2012-10-29 00:09 +0100
http://bitbucket.org/pypy/pypy/changeset/663521b4c7e8/

Log:	progress

diff --git a/pypy/module/_md5/test/test_md5.py b/pypy/module/_md5/test/test_md5.py
--- a/pypy/module/_md5/test/test_md5.py
+++ b/pypy/module/_md5/test/test_md5.py
@@ -2,24 +2,16 @@
 Tests for the md5 module implemented at interp-level in pypy/module/md5.
 """
 
-import py, sys
-from pypy.conftest import gettestobjspace
-
 
 class AppTestMD5(object):
+    spaceconfig = dict(usemodules=['_md5'])
 
     def setup_class(cls):
-        """
-        Create a space with the md5 module and import it for use by the
-        tests.
-        """
-        cls.space = gettestobjspace(usemodules=['_md5'])
         cls.w_md5 = cls.space.appexec([], """():
             import md5
             return md5
         """)
 
-
     def test_digest_size(self):
         """
         md5.digest_size should be 16.
diff --git a/pypy/module/marshal/test/test_marshal.py b/pypy/module/marshal/test/test_marshal.py
--- a/pypy/module/marshal/test/test_marshal.py
+++ b/pypy/module/marshal/test/test_marshal.py
@@ -182,16 +182,10 @@
 
 
 class AppTestRope(AppTestMarshal):
-    def setup_class(cls):
-        from pypy.conftest import gettestobjspace
-        cls.space = gettestobjspace(**{"objspace.std.withrope": True})
-        AppTestMarshal.setup_class.im_func(cls)
+    spaceconfig = {"objspace.std.withrope": True}
 
 class AppTestSmallLong(AppTestMarshal):
-    def setup_class(cls):
-        from pypy.conftest import gettestobjspace
-        cls.space = gettestobjspace(**{"objspace.std.withsmalllong": True})
-        AppTestMarshal.setup_class.im_func(cls)
+    spaceconfig = {"objspace.std.withsmalllong": True}
 
     def test_smalllong(self):
         import __pypy__
diff --git a/pypy/module/marshal/test/test_marshalimpl.py b/pypy/module/marshal/test/test_marshalimpl.py
--- a/pypy/module/marshal/test/test_marshalimpl.py
+++ b/pypy/module/marshal/test/test_marshalimpl.py
@@ -1,13 +1,10 @@
 from pypy.module.marshal import interp_marshal
 from pypy.interpreter.error import OperationError
-from pypy.conftest import gettestobjspace
 import sys
 
 
 class AppTestMarshalMore:
-    def setup_class(cls):
-        space = gettestobjspace(usemodules=('array',))
-        cls.space = space
+    spaceconfig = dict(usemodules=('array',))
 
     def test_long_0(self):
         import marshal
@@ -57,7 +54,5 @@
 
 
 class AppTestMarshalSmallLong(AppTestMarshalMore):
-    def setup_class(cls):
-        space = gettestobjspace(usemodules=('array',),
-                                **{"objspace.std.withsmalllong": True})
-        cls.space = space
+    spaceconfig = dict(usemodules=('array',),
+                       **{"objspace.std.withsmalllong": True})
diff --git a/pypy/module/math/test/test_math.py b/pypy/module/math/test/test_math.py
--- a/pypy/module/math/test/test_math.py
+++ b/pypy/module/math/test/test_math.py
@@ -1,12 +1,12 @@
 from __future__ import with_statement
 import sys
-from pypy.conftest import gettestobjspace
 from pypy.module.math.test import test_direct
 
 
 class AppTestMath:
+    spaceconfig = dict(usemodules=['math', 'struct'])
+
     def setup_class(cls):
-        cls.space = gettestobjspace(usemodules=['math', 'struct'])
         cls.w_cases = cls.space.wrap(test_direct.MathTests.TESTCASES)
         cls.w_consistent_host = cls.space.wrap(test_direct.consistent_host)
 
diff --git a/pypy/module/micronumpy/test/test_base.py b/pypy/module/micronumpy/test/test_base.py
--- a/pypy/module/micronumpy/test/test_base.py
+++ b/pypy/module/micronumpy/test/test_base.py
@@ -1,4 +1,3 @@
-from pypy.conftest import gettestobjspace
 from pypy.module.micronumpy.interp_dtype import get_dtype_cache
 from pypy.module.micronumpy.interp_ufuncs import (find_binop_result_dtype,
         find_unaryop_result_dtype)
@@ -8,6 +7,8 @@
 import sys
 
 class BaseNumpyAppTest(object):
+    spaceconfig = dict(usemodules=['micronumpy'])
+
     @classmethod
     def setup_class(cls):
         if option.runappdirect:
@@ -15,7 +16,6 @@
                 import numpy
                 sys.modules['numpypy'] = numpy
                 sys.modules['_numpypy'] = numpy
-        cls.space = gettestobjspace(usemodules=['micronumpy'])
         cls.w_non_native_prefix = cls.space.wrap(nonnative_byteorder_prefix)
         cls.w_native_prefix = cls.space.wrap(byteorder_prefix)
 
diff --git a/pypy/module/mmap/test/test_mmap.py b/pypy/module/mmap/test/test_mmap.py
--- a/pypy/module/mmap/test/test_mmap.py
+++ b/pypy/module/mmap/test/test_mmap.py
@@ -1,13 +1,12 @@
 from __future__ import with_statement
-from pypy.conftest import gettestobjspace
 from pypy.tool.udir import udir
 import os
 
 class AppTestMMap:
+    spaceconfig = dict(usemodules=('mmap',))
+
     def setup_class(cls):
-        space = gettestobjspace(usemodules=('mmap',))
-        cls.space = space
-        cls.w_tmpname = space.wrap(str(udir.join('mmap-')))
+        cls.w_tmpname = cls.space.wrap(str(udir.join('mmap-')))
 
     def test_page_size(self):
         import mmap


More information about the pypy-commit mailing list