[pypy-commit] pypy kill-someobject: fix tests
fijal
noreply at buildbot.pypy.org
Fri Oct 12 15:32:56 CEST 2012
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: kill-someobject
Changeset: r58035:66fc020fbd16
Date: 2012-10-12 15:10 +0200
http://bitbucket.org/pypy/pypy/changeset/66fc020fbd16/
Log: fix tests
diff --git a/pypy/rlib/parsing/test/test_tree.py b/pypy/rlib/parsing/test/test_tree.py
--- a/pypy/rlib/parsing/test/test_tree.py
+++ b/pypy/rlib/parsing/test/test_tree.py
@@ -56,9 +56,12 @@
def foo():
tree = Nonterminal(symbol="a",
children=[])
- return tree.getsourcepos()
+ try:
+ return tree.getsourcepos()
+ except IndexError:
+ return -42
f = self.compile(foo)
- py.test.raises(IndexError, f)
+ assert f() == -42
def test_nonterminal_nested_empty(self):
def foo():
@@ -70,9 +73,12 @@
children=[Nonterminal(symbol="c",
children=[Nonterminal(symbol="c",
children=[])])])])])])])
- return tree.getsourcepos()
+ try:
+ return tree.getsourcepos()
+ except IndexError:
+ return -42
f = self.compile(foo)
- py.test.raises(IndexError, f)
+ assert f() == -42
class TestTreeTranslatedLLType(BaseTestTreeTranslated):
More information about the pypy-commit
mailing list