[pypy-commit] pypy less-gettestobjspace: progress

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


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

Log:	progress

diff --git a/pypy/module/_random/test/test_random.py b/pypy/module/_random/test/test_random.py
--- a/pypy/module/_random/test/test_random.py
+++ b/pypy/module/_random/test/test_random.py
@@ -1,9 +1,5 @@
-import py
-from pypy.conftest import gettestobjspace
-
 class AppTestRandom:
-    def setup_class(cls):
-        cls.space = gettestobjspace(usemodules=['_random'])
+    spaceconfig = dict(usemodules=['_random'])
 
     def test_dict(self):
         import _random
diff --git a/pypy/module/_rawffi/test/test__rawffi.py b/pypy/module/_rawffi/test/test__rawffi.py
--- a/pypy/module/_rawffi/test/test__rawffi.py
+++ b/pypy/module/_rawffi/test/test__rawffi.py
@@ -1,6 +1,3 @@
-
-
-from pypy.conftest import gettestobjspace
 from pypy.translator.platform import platform
 from pypy.translator.tool.cbuild import ExternalCompilationInfo
 from pypy.module._rawffi.interp_rawffi import TYPEMAP
@@ -9,6 +6,8 @@
 import os, sys, py
 
 class AppTestFfi:
+    spaceconfig = dict(usemodules=['_rawffi', 'struct'])
+
     def prepare_c_example():
         from pypy.tool.udir import udir
         c_file = udir.ensure("test__rawffi", dir=1).join("xlib.c")
@@ -197,9 +196,8 @@
     prepare_c_example = staticmethod(prepare_c_example)
     
     def setup_class(cls):
+        space = cls.space
         from pypy.rlib.clibffi import get_libc_name
-        space = gettestobjspace(usemodules=('_rawffi', 'struct'))
-        cls.space = space
         cls.w_lib_name = space.wrap(cls.prepare_c_example())
         cls.w_libc_name = space.wrap(get_libc_name())
         if sys.platform == 'win32':
@@ -1030,10 +1028,10 @@
         S2E.get_ffi_type()     # does not hang
 
 class AppTestAutoFree:
+    spaceconfig = dict(usemodules=['_rawffi', 'struct'])
+    
     def setup_class(cls):
-        space = gettestobjspace(usemodules=('_rawffi', 'struct'))
-        cls.space = space
-        cls.w_sizes_and_alignments = space.wrap(dict(
+        cls.w_sizes_and_alignments = cls.space.wrap(dict(
             [(k, (v.c_size, v.c_alignment)) for k,v in TYPEMAP.iteritems()]))
         Tracker.DO_TRACING = True
 
diff --git a/pypy/module/_rawffi/test/test_nested.py b/pypy/module/_rawffi/test/test_nested.py
--- a/pypy/module/_rawffi/test/test_nested.py
+++ b/pypy/module/_rawffi/test/test_nested.py
@@ -1,9 +1,5 @@
-from pypy.conftest import gettestobjspace
-
 class AppTestNested:
-    def setup_class(cls):
-        space = gettestobjspace(usemodules=('_rawffi', 'struct'))
-        cls.space = space
+    spaceconfig = dict(usemodules=['_rawffi', 'struct'])
 
     def test_inspect_structure(self):
         import _rawffi, struct
diff --git a/pypy/module/_rawffi/test/test_tracker.py b/pypy/module/_rawffi/test/test_tracker.py
--- a/pypy/module/_rawffi/test/test_tracker.py
+++ b/pypy/module/_rawffi/test/test_tracker.py
@@ -1,12 +1,10 @@
-
-from pypy.conftest import gettestobjspace
 from pypy.module._rawffi.tracker import Tracker
 
 class AppTestTracker:
+    spaceconfig = dict(usemodules=['_rawffi', 'struct'])
+
     def setup_class(cls):
         Tracker.DO_TRACING = True
-        space = gettestobjspace(usemodules=('_rawffi','struct'))
-        cls.space = space
 
     def test_array(self):
         import _rawffi
diff --git a/pypy/module/rctime/test/test_rctime.py b/pypy/module/rctime/test/test_rctime.py
--- a/pypy/module/rctime/test/test_rctime.py
+++ b/pypy/module/rctime/test/test_rctime.py
@@ -1,10 +1,5 @@
-from pypy.conftest import gettestobjspace
-import os
-
 class AppTestRCTime:
-    def setup_class(cls):
-        space = gettestobjspace(usemodules=('rctime', 'struct'))
-        cls.space = space
+    spaceconfig = dict(usemodules=['rctime', 'struct'])
 
     def test_attributes(self):
         import time as rctime


More information about the pypy-commit mailing list