[pypy-svn] r14185 - pypy/dist/pypy/interpreter/test
ludal at codespeak.net
ludal at codespeak.net
Sun Jul 3 20:44:19 CEST 2005
Author: ludal
Date: Sun Jul 3 20:44:17 2005
New Revision: 14185
Modified:
pypy/dist/pypy/interpreter/test/test_interpreter.py
Log:
* run tests also with PythonCompiler
Modified: pypy/dist/pypy/interpreter/test/test_interpreter.py
==============================================================================
--- pypy/dist/pypy/interpreter/test/test_interpreter.py (original)
+++ pypy/dist/pypy/interpreter/test/test_interpreter.py Sun Jul 3 20:44:17 2005
@@ -1,4 +1,6 @@
import py
+import sys
+from pypy.interpreter.pycompiler import PythonCompiler
class TestInterpreter:
def codetest(self, source, functionname, args):
@@ -13,7 +15,6 @@
w = space.wrap
w_code = space.builtin.call('compile',
w(source), w('<string>'), w('exec'), w(0), w(0))
- ec = executioncontext.ExecutionContext(space)
tempmodule = module.Module(space, w("__temp__"))
w_glob = tempmodule.w_dict
@@ -226,6 +227,23 @@
assert self.codetest(code, 'g', [12, {}]) == ()
assert self.codetest(code, 'g', [12, {3:1}]) == (3,)
+class TestPyPyInterpreter(TestInterpreter):
+ """Runs the previous test with the pypy parser"""
+ def setup_class(klass):
+ sys.setrecursionlimit(10000)
+
+ def setup_method(self,arg):
+ ec = self.space.getexecutioncontext()
+ self.saved_compiler = ec.compiler
+ ec.compiler = PythonCompiler(self.space)
+
+ def teardown_method(self,arg):
+ ec = self.space.getexecutioncontext()
+ ec.compiler = self.saved_compiler
+
+ def test_extended_arg(self):
+ py.test.skip("Probably hits a bug in the compiler module")
+
class AppTestInterpreter:
def test_trivial(self):
x = 42
@@ -258,3 +276,4 @@
def test_identity(self):
def f(x): return x
assert f(666) == 666
+
More information about the Pypy-commit
mailing list