[pypy-commit] pypy default: put this in a base test class instead of repeating it

bdkearns noreply at buildbot.pypy.org
Sat Feb 9 23:04:13 CET 2013


Author: Brian Kearns <bdkearns at gmail.com>
Branch: 
Changeset: r61013:3e9687a238a8
Date: 2013-02-09 17:04 -0500
http://bitbucket.org/pypy/pypy/changeset/3e9687a238a8/

Log:	put this in a base test class instead of repeating it

diff --git a/pypy/module/micronumpy/test/test_dtypes.py b/pypy/module/micronumpy/test/test_dtypes.py
--- a/pypy/module/micronumpy/test/test_dtypes.py
+++ b/pypy/module/micronumpy/test/test_dtypes.py
@@ -3,7 +3,7 @@
 from pypy.module.micronumpy.test.test_base import BaseNumpyAppTest
 from pypy.interpreter.gateway import interp2app
 
-class AppTestDtypes(BaseNumpyAppTest):
+class BaseAppTestDtypes(BaseNumpyAppTest):
     def setup_class(cls):
         BaseNumpyAppTest.setup_class.im_func(cls)
         if option.runappdirect:
@@ -15,6 +15,7 @@
             ptr_size = rffi.sizeof(rffi.CCHARP)
         cls.w_ptr_size = cls.space.wrap(ptr_size)
 
+class AppTestDtypes(BaseAppTestDtypes):
     def test_dtype(self):
         from _numpypy import dtype
 
@@ -256,18 +257,7 @@
             assert hash(tp(value)) == hash(value)
 
 
-class AppTestTypes(BaseNumpyAppTest):
-    def setup_class(cls):
-        BaseNumpyAppTest.setup_class.im_func(cls)
-        if option.runappdirect:
-            import platform
-            bits, linkage = platform.architecture()
-            ptr_size = int(bits[:-3]) // 8
-        else:
-            from rpython.rtyper.lltypesystem import rffi
-            ptr_size = rffi.sizeof(rffi.CCHARP)
-        cls.w_ptr_size = cls.space.wrap(ptr_size)
-
+class AppTestTypes(BaseAppTestDtypes):
     def test_abstract_types(self):
         import _numpypy as numpy
         raises(TypeError, numpy.generic, 0)


More information about the pypy-commit mailing list