[pypy-svn] rev 792 - pypy/trunk/src/pypy/interpreter/test

mwh at codespeak.net mwh at codespeak.net
Mon Jun 9 14:04:36 CEST 2003


Author: mwh
Date: Mon Jun  9 14:04:36 2003
New Revision: 792

Modified:
   pypy/trunk/src/pypy/interpreter/test/test_interpreter.py
Log:
Reduce noise.
Enable some exception tests that now pass.
Tweak a test to fail instead of erroring out.


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	Mon Jun  9 14:04:36 2003
@@ -27,7 +27,7 @@
         try:
             w_output = space.call(wrappedfunc, wrappedargs, wrappedkwds)
         except baseobjspace.OperationError, e:
-            e.print_detailed_traceback(space)
+            #e.print_detailed_traceback(space)
             return '<<<%s>>>' % e.errorstr(space)
         else:
             return space.unwrap(w_output)
@@ -73,8 +73,7 @@
 ''', 'f', [])
         self.assertEquals(x, 1)
 
-    def XXXtest_exception(self):
-        """ exception raising currently semi-broken """
+    def test_exception(self):
         x = self.codetest('''
 def f():
     try:
@@ -97,16 +96,14 @@
         self.assertEquals(self.codetest(code, 'f', [0]), -12)
         self.assertEquals(self.codetest(code, 'f', [1]), 1)
 
-    def XXXtest_raise(self):
-        """ depends on being able to import types """
+    def test_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 XXXtest_except2(self):
-        """ depends on being able to import types """
+    def test_except2(self):
         x = self.codetest('''
 def f():
     try:
@@ -135,7 +132,7 @@
         self.assertEquals(self.codetest(code, 'f', [0]), "infinite result")
         ess = "TypeError: unsupported operand type"
         res = self.codetest(code, 'f', ['x'])
-        self.failUnless(res.index(ess) >= 0)
+        self.failUnless(res.find(ess) >= 0)
         # the following (original) test was a bit too strict...:
         # self.assertEquals(self.codetest(code, 'f', ['x']), "<<<TypeError: unsupported operand type(s) for //: 'int' and 'str'>>>")
 


More information about the Pypy-commit mailing list