[pypy-svn] r42676 - pypy/dist/pypy/objspace/test

cfbolz at codespeak.net cfbolz at codespeak.net
Fri May 4 13:25:12 CEST 2007


Author: cfbolz
Date: Fri May  4 13:25:11 2007
New Revision: 42676

Modified:
   pypy/dist/pypy/objspace/test/test_thunkobjspace.py
Log:
sort of bug in the thunk space


Modified: pypy/dist/pypy/objspace/test/test_thunkobjspace.py
==============================================================================
--- pypy/dist/pypy/objspace/test/test_thunkobjspace.py	(original)
+++ pypy/dist/pypy/objspace/test/test_thunkobjspace.py	Fri May  4 13:25:11 2007
@@ -98,3 +98,17 @@
         assert lst == [3]
         assert type(y) is int
         assert lst == [3]
+
+    def test_exception_in_thunk(self):
+        skip("thunk about what should happen there!")
+        from __pypy__ import lazy
+        def f(x):
+            if x:
+                return 42
+            raise ValueError
+        f = lazy(f)
+        y = f(3)
+        assert y == 42
+        y = f(0)
+        raises(ValueError, "str(y)")
+        raises(ValueError, "str(y)") # raises "RuntimeError: thunk is already being computed"



More information about the Pypy-commit mailing list