[pypy-svn] r68325 - pypy/trunk/pypy/jit/metainterp/test

arigo at codespeak.net arigo at codespeak.net
Sun Oct 11 22:56:55 CEST 2009


Author: arigo
Date: Sun Oct 11 22:56:53 2009
New Revision: 68325

Modified:
   pypy/trunk/pypy/jit/metainterp/test/test_tl.py
Log:
Fix for jit.backend.x86.test.test_zrpy_tl: don't
use a setup_class() method here.  It's a complete
mess to call a parent setup_class() that may not
be here, so I just give up.


Modified: pypy/trunk/pypy/jit/metainterp/test/test_tl.py
==============================================================================
--- pypy/trunk/pypy/jit/metainterp/test/test_tl.py	(original)
+++ pypy/trunk/pypy/jit/metainterp/test/test_tl.py	Sun Oct 11 22:56:53 2009
@@ -17,7 +17,7 @@
         res = self.meta_interp(main, [1, 10])
         assert res == 100
 
-    def setup_class(cls):
+    def _get_main(self):
         from pypy.jit.tl.tl import interp_without_call
         from pypy.jit.tl.tlopcode import compile
 
@@ -64,12 +64,13 @@
         def main(n, inputarg):
             code = codes[n]
             return interp_without_call(code, inputarg=inputarg)
-        cls.main = main
+        return main
 
     def test_tl_base(self):
         # 'backendopt=True' is used on lltype to kill unneeded access
         # to the class, which generates spurious 'guard_class'
-        res = self.meta_interp(self.main.im_func, [0, 6], listops=True,
+        main = self._get_main()
+        res = self.meta_interp(main, [0, 6], listops=True,
                                backendopt=True)
         assert res == 5040
         self.check_loops({'int_mul':1, 'jump':1,
@@ -77,9 +78,10 @@
                           'guard_false':1})
 
     def test_tl_2(self):
-        res = self.meta_interp(self.main.im_func, [1, 10], listops=True,
+        main = self._get_main()
+        res = self.meta_interp(main, [1, 10], listops=True,
                                backendopt=True)
-        assert res == self.main.im_func(1, 10)
+        assert res == main(1, 10)
         self.check_loops({'int_sub':1, 'int_le':1,
                          'int_is_true':1, 'guard_false':1, 'jump':1})
 



More information about the Pypy-commit mailing list