[pypy-svn] r28959 - pypy/dist/pypy/module/_stackless/test

cfbolz at codespeak.net cfbolz at codespeak.net
Mon Jun 19 18:46:43 CEST 2006


Author: cfbolz
Date: Mon Jun 19 18:46:42 2006
New Revision: 28959

Modified:
   pypy/dist/pypy/module/_stackless/test/test_coroutine.py
Log:
found a way to crash coroutines. no clue why :-(


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	Mon Jun 19 18:46:42 2006
@@ -65,6 +65,32 @@
         else:
             raise AssertionError("exception not propagated")
 
+    def test_strange_test(self):
+        skip("test is failing for atm unknown reasons")
+        from _stackless import coroutine
+        def f():
+            print "in new coro"
+            return 42
+        def create():
+            b = coroutine()
+            b.bind(f)
+            print "bound"
+            b.switch()
+            print "switched"
+            return b
+        a = coroutine()
+        a.bind(create)
+        b = a.switch()
+        # now b.parent = a
+        def nothing():
+            pass
+        a.bind(nothing)
+        def kill():
+            # this sets a.parent = b
+            a.kill()
+        b.bind(kill)
+        b.switch()
+
     def test_finished(self):
         skip('should a coroutine be a zombie after being done?')
         import _stackless as stackless



More information about the Pypy-commit mailing list