[pypy-svn] r69970 - pypy/trunk/pypy/translator/stackless/test

cfbolz at codespeak.net cfbolz at codespeak.net
Tue Dec 8 10:24:25 CET 2009


Author: cfbolz
Date: Tue Dec  8 10:24:25 2009
New Revision: 69970

Modified:
   pypy/trunk/pypy/translator/stackless/test/test_coroutine_reconstruction.py
Log:
I broke this test via the merge from the io branch. Fix it.


Modified: pypy/trunk/pypy/translator/stackless/test/test_coroutine_reconstruction.py
==============================================================================
--- pypy/trunk/pypy/translator/stackless/test/test_coroutine_reconstruction.py	(original)
+++ pypy/trunk/pypy/translator/stackless/test/test_coroutine_reconstruction.py	Tue Dec  8 10:24:25 2009
@@ -5,10 +5,15 @@
 from pypy.rpython.lltypesystem.lloperation import llop
 from pypy.rpython.lltypesystem import lltype
 
+namespace = rcoroutine.make_coroutine_classes(object)
+syncstate = namespace['syncstate']
+AbstractThunk = namespace['AbstractThunk']
+Coroutine = namespace['Coroutine']
+
 class TestCoroutineReconstruction:
 
     def setup_meth(self):
-        rcoroutine.syncstate.reset()
+        syncstate.reset()
 
     def test_simple_ish(self):
 
@@ -23,7 +28,7 @@
             rstack.resume_point("f_1", coro, n, x)
             output.append(x)
 
-        class T(rcoroutine.AbstractThunk):
+        class T(AbstractThunk):
             def __init__(self, arg_coro, arg_n, arg_x):
                 self.arg_coro = arg_coro
                 self.arg_n = arg_n
@@ -32,17 +37,17 @@
                 f(self.arg_coro, self.arg_n, self.arg_x)
 
         def example():
-            main_coro = rcoroutine.Coroutine.getcurrent()
-            sub_coro = rcoroutine.Coroutine()
+            main_coro = Coroutine.getcurrent()
+            sub_coro = Coroutine()
             thunk_f = T(main_coro, 5, 1)
             sub_coro.bind(thunk_f)
             sub_coro.switch()
 
-            new_coro = rcoroutine.Coroutine()
+            new_coro = Coroutine()
             new_thunk_f = T(main_coro, 5, 1)
             new_coro.bind(new_thunk_f)
 
-            costate = rcoroutine.Coroutine._get_default_costate()
+            costate = Coroutine._get_default_costate()
             bottom = resume_state_create(None, "yield_current_frame_to_caller_1")
             _bind_frame = resume_state_create(bottom, "coroutine__bind", costate)
             f_frame_1 = resume_state_create(_bind_frame, "f_1", main_coro, 5, 1)



More information about the Pypy-commit mailing list