[pypy-svn] r74216 - in pypy/branch/py12/pypy: jit/tl/test module/_sre/test tool tool/pytest tool/test translator/platform

hpk at codespeak.net hpk at codespeak.net
Thu Apr 29 11:02:42 CEST 2010


Author: hpk
Date: Thu Apr 29 11:02:40 2010
New Revision: 74216

Modified:
   pypy/branch/py12/pypy/jit/tl/test/test_pypyjit.py
   pypy/branch/py12/pypy/module/_sre/test/test_app_sre.py
   pypy/branch/py12/pypy/tool/ansi_mandelbrot.py
   pypy/branch/py12/pypy/tool/ansi_print.py
   pypy/branch/py12/pypy/tool/pytest/appsupport.py
   pypy/branch/py12/pypy/tool/test/test_pytestsupport.py
   pypy/branch/py12/pypy/translator/platform/__init__.py
Log:
use new public API of py.test (upcoming as 1.2.2) instead of internal imports 


Modified: pypy/branch/py12/pypy/jit/tl/test/test_pypyjit.py
==============================================================================
--- pypy/branch/py12/pypy/jit/tl/test/test_pypyjit.py	(original)
+++ pypy/branch/py12/pypy/jit/tl/test/test_pypyjit.py	Thu Apr 29 11:02:40 2010
@@ -21,7 +21,7 @@
 def check_crasher(func_name):
     try:
         JIT_EXECUTABLE.sysexec(CRASH_FILE, func_name)
-    except py.impl.process.cmdexec.ExecutionFailed, e:
+    except py.process.cmdexec.Error, e:
         print "stderr"
         print "------"
         print e.err

Modified: pypy/branch/py12/pypy/module/_sre/test/test_app_sre.py
==============================================================================
--- pypy/branch/py12/pypy/module/_sre/test/test_app_sre.py	(original)
+++ pypy/branch/py12/pypy/module/_sre/test/test_app_sre.py	Thu Apr 29 11:02:40 2010
@@ -3,7 +3,6 @@
 from py.test import raises, skip
 from pypy.interpreter.gateway import app2interp_temp
 from pypy.conftest import gettestobjspace, option
-from py.impl.test.outcome import Skipped
 
 def init_globals_hack(space):
     space.appexec([space.wrap(autopath.this_dir)], """(this_dir):
@@ -288,7 +287,7 @@
         # This imports support_test_sre as the global "s"
         try:
             cls.space = gettestobjspace(usemodules=('_locale',))
-        except Skipped:
+        except py.test.skip.Exception:
             cls.space = gettestobjspace(usemodules=('_rawffi',))
         init_globals_hack(cls.space)
 
@@ -548,7 +547,7 @@
     def setup_class(cls):
         try:
             cls.space = gettestobjspace(usemodules=('_locale',))
-        except Skipped:
+        except py.test.skip.Exception:
             cls.space = gettestobjspace(usemodules=('_rawffi',))
         # This imports support_test_sre as the global "s"
         init_globals_hack(cls.space)

Modified: pypy/branch/py12/pypy/tool/ansi_mandelbrot.py
==============================================================================
--- pypy/branch/py12/pypy/tool/ansi_mandelbrot.py	(original)
+++ pypy/branch/py12/pypy/tool/ansi_mandelbrot.py	Thu Apr 29 11:02:40 2010
@@ -1,6 +1,6 @@
 import sys
 
-from py.impl.io.terminalwriter import ansi_print, get_terminal_width
+from py.io import ansi_print, get_terminal_width
 
 """
 Black       0;30     Dark Gray     1;30

Modified: pypy/branch/py12/pypy/tool/ansi_print.py
==============================================================================
--- pypy/branch/py12/pypy/tool/ansi_print.py	(original)
+++ pypy/branch/py12/pypy/tool/ansi_print.py	Thu Apr 29 11:02:40 2010
@@ -3,8 +3,7 @@
 """
 
 import sys
-
-from py.impl.io.terminalwriter import ansi_print
+from py.io import ansi_print
 from pypy.tool.ansi_mandelbrot import Driver
 
 class AnsiLog:

Modified: pypy/branch/py12/pypy/tool/pytest/appsupport.py
==============================================================================
--- pypy/branch/py12/pypy/tool/pytest/appsupport.py	(original)
+++ pypy/branch/py12/pypy/tool/pytest/appsupport.py	Thu Apr 29 11:02:40 2010
@@ -1,10 +1,7 @@
 import autopath
 import py
-import py.impl.code.assertion
-from py.impl.code import _assertionold as exprinfo
 from pypy.interpreter import gateway
 from pypy.interpreter.error import OperationError
-from py.impl.test.outcome import ExceptionFailure
 
 # ____________________________________________________________
 
@@ -158,7 +155,7 @@
                 source = None
             from pypy import conftest
             if source and not conftest.option.nomagic: 
-                msg = exprinfo.interpret(source, runner, should_fail=True)
+                msg = py.code._reinterpret_old(source, runner, should_fail=True)
                 space.setattr(w_self, space.wrap('args'),
                             space.newtuple([space.wrap(msg)]))
                 w_msg = space.wrap(msg)
@@ -254,7 +251,7 @@
         if not value.match(space, w_ExpectedException):
             raise type, value, tb
         return excinfo
-    except ExceptionFailure, e:
+    except py.test.raises.Exception, e:
         e.tbindex = getattr(e, 'tbindex', -1) - 1
         raise
 

Modified: pypy/branch/py12/pypy/tool/test/test_pytestsupport.py
==============================================================================
--- pypy/branch/py12/pypy/tool/test/test_pytestsupport.py	(original)
+++ pypy/branch/py12/pypy/tool/test/test_pytestsupport.py	Thu Apr 29 11:02:40 2010
@@ -1,5 +1,4 @@
 import autopath
-from py.impl.code import _assertionold as exprinfo
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.gateway import app2interp_temp
 from pypy.interpreter.argument import Arguments
@@ -23,8 +22,8 @@
     co = PyCode._from_code(space, somefunc.func_code)
     pyframe = PyFrame(space, co, space.newdict(), None)
     runner = AppFrame(space, pyframe)
-    exprinfo.run("f = lambda x: x+1", runner)
-    msg = exprinfo.interpret("assert isinstance(f(2), float)", runner)
+    py.code.reinterpret_old("f = lambda x: x+1", runner, should_fail=False)
+    msg = py.code.reinterpret_old("assert isinstance(f(2), float)", runner)
     assert msg.startswith("assert isinstance(3, float)\n"
                           " +  where 3 = ")
 

Modified: pypy/branch/py12/pypy/translator/platform/__init__.py
==============================================================================
--- pypy/branch/py12/pypy/translator/platform/__init__.py	(original)
+++ pypy/branch/py12/pypy/translator/platform/__init__.py	Thu Apr 29 11:02:40 2010
@@ -6,7 +6,6 @@
 import sys, py, os
 
 from pypy.tool.ansi_print import ansi_log
-from py.impl.code.code import safe_repr
 log = py.log.Producer("platform")
 py.log.setconsumer("platform", ansi_log)
 
@@ -19,9 +18,9 @@
 
     def __repr__(self):
         if self.err:
-            return "<CompilationError err=%s>" % safe_repr(self.err)
+            return "<CompilationError err=%s>" % repr(self.err)
         else:
-            return "<CompilationError out=%s>" % safe_repr(self.out)
+            return "<CompilationError out=%s>" % repr(self.out)
 
     __str__ = __repr__
 



More information about the Pypy-commit mailing list