[pypy-svn] pypy default: Be much more precise about this test.
alex_gaynor
commits-noreply at bitbucket.org
Wed Feb 23 19:01:23 CET 2011
Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch:
Changeset: r42242:4336427adba2
Date: 2011-02-23 13:01 -0500
http://bitbucket.org/pypy/pypy/changeset/4336427adba2/
Log: Be much more precise about this test.
diff --git a/pypy/module/pypyjit/test_pypy_c/test_pypy_c_new.py b/pypy/module/pypyjit/test_pypy_c/test_pypy_c_new.py
--- a/pypy/module/pypyjit/test_pypy_c/test_pypy_c_new.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_pypy_c_new.py
@@ -58,19 +58,18 @@
def test_cmp_exc(self):
def f1(n):
- def f():
- raise KeyError
-
+ # So we don't get a LOAD_GLOBAL op
+ KE = KeyError
i = 0
while i < n:
try:
- f()
- except KeyError: # ID: except
+ raise KE
+ except KE: # ID: except
i += 1
return i
log = self.run(f1, [10000])
assert log.result == 10000
loop, = log.loops_by_id("except")
- ops = [o.name for o in loop.ops_by_id("except")]
- assert "call_may_force" not in ops
\ No newline at end of file
+ ops = list(loop.ops_by_id("except", opcode="COMPARE_OP"))
+ assert ops == []
More information about the Pypy-commit
mailing list