[pypy-svn] r72154 - pypy/trunk/pypy/module/pypyjit/test
fijal at codespeak.net
fijal at codespeak.net
Fri Mar 12 03:38:34 CET 2010
Author: fijal
Date: Fri Mar 12 03:38:32 2010
New Revision: 72154
Modified:
pypy/trunk/pypy/module/pypyjit/test/test_pypy_c.py
Log:
Add a test that I thought would work, not sure why it does not
Modified: pypy/trunk/pypy/module/pypyjit/test/test_pypy_c.py
==============================================================================
--- pypy/trunk/pypy/module/pypyjit/test/test_pypy_c.py (original)
+++ pypy/trunk/pypy/module/pypyjit/test/test_pypy_c.py Fri Mar 12 03:38:32 2010
@@ -572,6 +572,21 @@
# we allocate virtual ref and frame, we don't want block
assert len(bytecode.get_opnames('new_with_vtable')) == 2
+ def test_import_in_function(self):
+ py.test.skip("does not work, why???")
+ self.run_source('''
+ def main():
+ i = 0
+ while i < 100:
+ from sys import version
+ i += 1
+ return i
+ ''', 100, ([], 100))
+ bytecode, = self.get_by_bytecode('IMPORT_NAME')
+ bytecode2, = self.get_by_bytecode('IMPORT_FROM')
+ assert len(bytecode.get_opnames('call')) == 0
+ assert len(bytecode2.get_opnames('call')) == 0
+
class AppTestJIT(PyPyCJITTests):
def setup_class(cls):
if not option.runappdirect:
More information about the Pypy-commit
mailing list