[pypy-svn] pypy default: Fix this test at applevel now that we have real helpers.

alex_gaynor commits-noreply at bitbucket.org
Wed Jan 19 16:30:23 CET 2011


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r40925:96733adf23cf
Date: 2011-01-19 09:30 -0600
http://bitbucket.org/pypy/pypy/changeset/96733adf23cf/

Log:	Fix this test at applevel now that we have real helpers.

diff --git a/pypy/objspace/std/test/test_userobject.py b/pypy/objspace/std/test/test_userobject.py
--- a/pypy/objspace/std/test/test_userobject.py
+++ b/pypy/objspace/std/test/test_userobject.py
@@ -9,16 +9,11 @@
     def setup_class(cls):
         from pypy import conftest
         cls.space = conftest.gettestobjspace(**cls.OPTIONS)
-        #
+        cls.w_runappdirect = cls.space.wrap(bool(conftest.option.runappdirect))
+
+    def w_rand(self):
         import random
-        def fn_rand():
-            return cls.space.wrap(random.randrange(0, 5))
-        fn_rand.unwrap_spec = []
-        if conftest.option.runappdirect:
-            cls.w_rand = fn_rand
-        else:
-            cls.w_rand = cls.space.wrap(gateway.interp2app(fn_rand))
-        cls.w_runappdirect = cls.space.wrap(bool(conftest.option.runappdirect))
+        return random.randrange(0, 5)
 
     def test_emptyclass(self):
         class empty(object): pass


More information about the Pypy-commit mailing list