[pypy-commit] pypy exc-later: Simplify getitem tests, since flowspace doesn't do anything special with it any more
rlamy
noreply at buildbot.pypy.org
Tue Mar 17 20:29:37 CET 2015
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: exc-later
Changeset: r76446:fad5ab2ee8d3
Date: 2015-03-15 03:16 +0000
http://bitbucket.org/pypy/pypy/changeset/fad5ab2ee8d3/
Log: Simplify getitem tests, since flowspace doesn't do anything special
with it any more
diff --git a/rpython/flowspace/test/test_objspace.py b/rpython/flowspace/test/test_objspace.py
--- a/rpython/flowspace/test/test_objspace.py
+++ b/rpython/flowspace/test/test_objspace.py
@@ -858,7 +858,7 @@
raise
graph = self.codetest(f)
simplify_graph(graph)
- assert self.all_operations(graph) == {'getitem_idx': 1}
+ assert self.all_operations(graph) == {'getitem': 1}
g = lambda: None
def f(c, x):
@@ -868,7 +868,7 @@
g()
graph = self.codetest(f)
simplify_graph(graph)
- assert self.all_operations(graph) == {'getitem_idx': 1,
+ assert self.all_operations(graph) == {'getitem': 1,
'simple_call': 2}
def f(c, x):
@@ -878,58 +878,12 @@
raise
graph = self.codetest(f)
simplify_graph(graph)
- assert self.all_operations(graph) == {'getitem_idx': 1}
+ assert self.all_operations(graph) == {'getitem': 1}
def f(c, x):
try:
return c[x]
except KeyError:
- raise
- graph = self.codetest(f)
- simplify_graph(graph)
- assert self.all_operations(graph) == {'getitem': 1}
-
- def f(c, x):
- try:
- return c[x]
- except ValueError:
- raise
- graph = self.codetest(f)
- simplify_graph(graph)
- assert self.all_operations(graph) == {'getitem': 1}
-
- def f(c, x):
- try:
- return c[x]
- except Exception:
- return -1
- graph = self.codetest(f)
- simplify_graph(graph)
- self.show(graph)
- assert self.all_operations(graph) == {'getitem_idx': 1}
-
- def f(c, x):
- try:
- return c[x]
- except IndexError:
- return -1
- graph = self.codetest(f)
- simplify_graph(graph)
- assert self.all_operations(graph) == {'getitem_idx': 1}
-
- def f(c, x):
- try:
- return c[x]
- except KeyError:
- return -1
- graph = self.codetest(f)
- simplify_graph(graph)
- assert self.all_operations(graph) == {'getitem': 1}
-
- def f(c, x):
- try:
- return c[x]
- except ValueError:
return -1
graph = self.codetest(f)
simplify_graph(graph)
More information about the pypy-commit
mailing list