[pypy-svn] r17393 - pypy/dist/pypy/interpreter/pyparser/test
pedronis at codespeak.net
pedronis at codespeak.net
Thu Sep 8 21:23:27 CEST 2005
Author: pedronis
Date: Thu Sep 8 21:23:26 2005
New Revision: 17393
Modified:
pypy/dist/pypy/interpreter/pyparser/test/test_astbuilder.py
pypy/dist/pypy/interpreter/pyparser/test/test_astcompiler.py
Log:
check for flags in test_astcompiler,
try to parse and compile _file and _sio
parsing is giving different results, need to investigate
Modified: pypy/dist/pypy/interpreter/pyparser/test/test_astbuilder.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyparser/test/test_astbuilder.py (original)
+++ pypy/dist/pypy/interpreter/pyparser/test/test_astbuilder.py Thu Sep 8 21:23:26 2005
@@ -616,12 +616,24 @@
'snippet_decorators.py',
]
+LIBSTUFF = [
+ '_file.py',
+ '_sio.py'
+ ]
+
def test_snippets():
for snippet_name in SNIPPETS:
filepath = os.path.join(os.path.dirname(__file__), 'samples', snippet_name)
source = file(filepath).read()
yield check_expression, source, 'exec'
+def test_libstuff():
+ py.test.skip("failing, need to investigate")
+ for snippet_name in LIBSTUFF:
+ filepath = os.path.join(os.path.dirname(__file__), '../../../lib', snippet_name)
+ source = file(filepath).read()
+ yield check_expression, source, 'exec'
+
# FIXME: find the sys' attribute that define this
STDLIB_PATH = os.path.dirname(os.__file__)
def test_on_stdlib():
Modified: pypy/dist/pypy/interpreter/pyparser/test/test_astcompiler.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyparser/test/test_astcompiler.py (original)
+++ pypy/dist/pypy/interpreter/pyparser/test/test_astcompiler.py Thu Sep 8 21:23:26 2005
@@ -15,7 +15,7 @@
listmakers, genexps, dictmakers, multiexpr, attraccess, slices, imports,\
asserts, execs, prints, globs, raises_, imports_newstyle, augassigns, \
if_stmts, one_stmt_classdefs, one_stmt_funcdefs, tryexcepts, docstrings, \
- returns, SNIPPETS, SINGLE_INPUTS
+ returns, SNIPPETS, SINGLE_INPUTS, LIBSTUFF
from test_astbuilder import FakeSpace
@@ -97,6 +97,7 @@
dis.dis(sc_code)
assert ac_code.co_code == sc_code.co_code
assert ac_code.co_varnames == sc_code.co_varnames
+ assert ac_code.co_flags == sc_code.co_flags
assert len(ac_code.co_consts) == len(sc_code.co_consts)
for c1, c2 in zip( ac_code.co_consts, sc_code.co_consts ):
@@ -177,6 +178,12 @@
source = file(filepath).read()
yield check_compile, source, 'exec'
+def test_libstuff():
+ for snippet_name in LIBSTUFF:
+ filepath = os.path.join(os.path.dirname(__file__), '../../../lib', snippet_name)
+ source = file(filepath).read()
+ yield check_compile, source, 'exec'
+
def test_single_inputs():
for family in SINGLE_INPUTS:
More information about the Pypy-commit
mailing list