[pypy-commit] pypy stm-gc: Extra test.

arigo noreply at buildbot.pypy.org
Sun Apr 22 19:28:14 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: stm-gc
Changeset: r54622:c9a25e2c4e18
Date: 2012-04-22 15:49 +0200
http://bitbucket.org/pypy/pypy/changeset/c9a25e2c4e18/

Log:	Extra test.

diff --git a/pypy/rlib/test/test_rstm.py b/pypy/rlib/test/test_rstm.py
--- a/pypy/rlib/test/test_rstm.py
+++ b/pypy/rlib/test/test_rstm.py
@@ -1,4 +1,5 @@
 import random
+import py
 from pypy.rpython.lltypesystem import lltype, rffi
 from pypy.rlib import rstm
 
@@ -88,3 +89,14 @@
                 return [self, other]
     rstm.run_all_transactions(DoInOrder())
     assert seen != range(50) and sorted(seen) == range(50)
+
+def test_raise():
+    class MyException(Exception):
+        pass
+    class FooBar(rstm.Transaction):
+        def run(self):
+            raise MyException
+    class DoInOrder(rstm.Transaction):
+        def run(self):
+            return [FooBar() for i in range(10)]
+    py.test.raises(MyException, rstm.run_all_transactions, DoInOrder())


More information about the pypy-commit mailing list