[pypy-svn] rev 568 - pypy/trunk/src/pypy/interpreter/test
alex at codespeak.net
alex at codespeak.net
Tue May 27 16:00:52 CEST 2003
Author: alex
Date: Tue May 27 16:00:52 2003
New Revision: 568
Modified:
pypy/trunk/src/pypy/interpreter/test/test_executioncontext.py
pypy/trunk/src/pypy/interpreter/test/test_interpreter.py
Log:
the test now runs.
Modified: pypy/trunk/src/pypy/interpreter/test/test_executioncontext.py
==============================================================================
--- pypy/trunk/src/pypy/interpreter/test/test_executioncontext.py (original)
+++ pypy/trunk/src/pypy/interpreter/test/test_executioncontext.py Tue May 27 16:00:52 2003
@@ -1,16 +1,14 @@
-import unittest
-import support
+import testsupport
from pypy.interpreter.pyframe import PyFrame
from pypy.interpreter import baseobjspace, executioncontext
-from pypy.objspace.trivial import TrivialObjSpace
-class TestExecutionContext(unittest.TestCase):
+class TestExecutionContext(testsupport.TestCase):
def test_trivial1(self):
# build frame
- space = TrivialObjSpace()
+ space = testsupport.objspace()
ec = executioncontext.ExecutionContext(space)
bytecode = compile('def f(x): return x+1', '', 'exec').co_consts[0]
@@ -24,4 +22,4 @@
if __name__ == '__main__':
- unittest.main()
+ testsupport.main()
Modified: pypy/trunk/src/pypy/interpreter/test/test_interpreter.py
==============================================================================
--- pypy/trunk/src/pypy/interpreter/test/test_interpreter.py (original)
+++ pypy/trunk/src/pypy/interpreter/test/test_interpreter.py Tue May 27 16:00:52 2003
@@ -39,29 +39,29 @@
def g(): return 42''', 'g', [])
self.assertEquals(x, 42)
- def test_trivial_call(self):
+ def aatest_trivial_call(self):
x = self.codetest('''
def f(): return 42
def g(): return f()''', 'g', [])
self.assertEquals(x, 42)
- def test_trivial_call2(self):
+ def aatest_trivial_call2(self):
x = self.codetest('''
def f(): return 1 + 1
def g(): return f()''', 'g', [])
self.assertEquals(x, 2)
- def test_print(self):
+ def aatest_print(self):
x = self.codetest('''
def g(): print 10''', 'g', [])
self.assertEquals(x, None)
- def test_identity(self):
+ def aatest_identity(self):
x = self.codetest('''
def g(x): return x''', 'g', [666])
self.assertEquals(x, 666)
- def test_exception(self):
+ def aatest_exception(self):
x = self.codetest('''
def f():
try:
@@ -71,7 +71,7 @@
''', 'f', [])
self.assertEquals(x, 1)
- def test_finally(self):
+ def aatest_finally(self):
code = '''
def f(a):
try:
@@ -84,14 +84,14 @@
self.assertEquals(self.codetest(code, 'f', [0]), -12)
self.assertEquals(self.codetest(code, 'f', [1]), 1)
- def test_raise(self):
+ def aatest_raise(self):
x = self.codetest('''
def f():
raise 1
''', 'f', [])
self.assertEquals(x, '<<<TypeError: exceptions must be classes, instances, or strings (deprecated), not int>>>')
- def test_except2(self):
+ def aatest_except2(self):
x = self.codetest('''
def f():
try:
@@ -106,7 +106,7 @@
''', 'f', [])
self.assertEquals(x, 5)
- def test_except3(self):
+ def aatest_except3(self):
code = '''
def f(v):
z = 0
@@ -120,7 +120,7 @@
self.assertEquals(self.codetest(code, 'f', [0]), "infinite result")
self.assertEquals(self.codetest(code, 'f', ['x']), "<<<TypeError: unsupported operand type(s) for //: 'int' and 'str'>>>")
- def test_break(self):
+ def aatest_break(self):
code = '''
def f(n):
total = 0
@@ -135,7 +135,7 @@
self.assertEquals(self.codetest(code, 'f', [4]), 1+2+3)
self.assertEquals(self.codetest(code, 'f', [9]), 1+2+3+4)
- def test_continue(self):
+ def aatest_continue(self):
code = '''
def f(n):
total = 0
More information about the Pypy-commit
mailing list