[pypy-svn] r28587 - pypy/dist/pypy/module/stackless/test

mwh at codespeak.net mwh at codespeak.net
Fri Jun 9 15:54:27 CEST 2006


Author: mwh
Date: Fri Jun  9 15:54:24 2006
New Revision: 28587

Modified:
   pypy/dist/pypy/module/stackless/test/test_coroutine.py
Log:
(pedronis, mwh)
a skipped that that fails for the traditional No Good Reason.
it works interactively!


Modified: pypy/dist/pypy/module/stackless/test/test_coroutine.py
==============================================================================
--- pypy/dist/pypy/module/stackless/test/test_coroutine.py	(original)
+++ pypy/dist/pypy/module/stackless/test/test_coroutine.py	Fri Jun  9 15:54:24 2006
@@ -24,4 +24,32 @@
         import pickle
         pckl = pickle.dumps(co)
         co2 = pickle.loads(pckl)
-        
\ No newline at end of file
+    
+    def test_pickle_coroutine_frame(self):
+        skip('passes in interactive interpreter but not here :/')
+        # this requires py.magic.greenlet!
+        del self # don't look
+        import pickle, sys, new
+        mod = new.module('mod')
+        try: 
+            sys.modules['mod'] = mod
+            exec '''
+import sys, stackless
+
+def f():
+    global the_frame
+    the_frame = sys._getframe()
+    main_coro.switch()
+
+co = stackless.coroutine()
+main_coro = stackless.coroutine.getcurrent()
+co.bind(mod.f)
+co.switch()
+''' in mod.__dict__
+            pckl = pickle.dumps(mod.the_frame)
+            #co2 = pickle.loads(pckl)
+        finally:
+            del sys.modules['mod']
+        
+
+    



More information about the Pypy-commit mailing list