[pypy-svn] r20453 - pypy/branch/somepbc-refactoring/pypy/translator/test

mwh at codespeak.net mwh at codespeak.net
Wed Nov 30 20:52:21 CET 2005


Author: mwh
Date: Wed Nov 30 20:52:20 2005
New Revision: 20453

Modified:
   pypy/branch/somepbc-refactoring/pypy/translator/test/test_annrpython.py
Log:
shrink test case somewhat.


Modified: pypy/branch/somepbc-refactoring/pypy/translator/test/test_annrpython.py
==============================================================================
--- pypy/branch/somepbc-refactoring/pypy/translator/test/test_annrpython.py	(original)
+++ pypy/branch/somepbc-refactoring/pypy/translator/test/test_annrpython.py	Wed Nov 30 20:52:20 2005
@@ -1841,19 +1841,12 @@
     def test_getorbuild_as_attr(self):
         from pypy.tool.cache import Cache
         class SpaceCache(Cache):
-            def __init__(self, space):
-                Cache.__init__(self)
-                self.space = space
             def _build(self, callable):
-                return callable(self.space)
+                return callable()
         class CacheX(Cache):
-            def __init__(self, space):
-                Cache.__init__(self)
             def _build(self, key):
                 return key.x
         class CacheY(Cache):
-            def __init__(self, space):
-                Cache.__init__(self)
             def _build(self, key):
                 return key.y
         class X:
@@ -1866,17 +1859,12 @@
                 self.y = y
             def _freeze_(self):
                 return True
-        class Space:
-            def __init__(self):
-                self.fromcache = SpaceCache(self).getorbuild
-            def _freeze_(self):
-                return True
-        space = Space()
         X1 = X(1)
         Y2 = Y(2)
+        fromcache = SpaceCache().getorbuild
         def f():
-            return space.fromcache(CacheX).getorbuild(X1) + \
-                   space.fromcache(CacheY).getorbuild(Y2)
+            return fromcache(CacheX).getorbuild(X1) + \
+                   fromcache(CacheY).getorbuild(Y2)
 
         a = self.RPythonAnnotator()
         s = a.build_types(f, [])



More information about the Pypy-commit mailing list