[pypy-svn] r67182 - pypy/trunk/pypy

arigo at codespeak.net arigo at codespeak.net
Tue Aug 25 12:13:32 CEST 2009


Author: arigo
Date: Tue Aug 25 12:13:31 2009
New Revision: 67182

Added:
   pypy/trunk/pypy/conftest.py.merge.tmp
      - copied, changed from r67180, pypy/trunk/pypy/conftest.py
Log:
(benjamin)
emulate pypyraises when running with -A


Copied: pypy/trunk/pypy/conftest.py.merge.tmp (from r67180, pypy/trunk/pypy/conftest.py)
==============================================================================
--- pypy/trunk/pypy/conftest.py	(original)
+++ pypy/trunk/pypy/conftest.py.merge.tmp	Tue Aug 25 12:13:31 2009
@@ -188,13 +188,21 @@
 # Interfacing/Integrating with py.test's collection process 
 #
 #
-def ensure_pytest_builtin_helpers(helpers='skip raises'.split()):
+
+def _pytest_raises_wrapper(*args, **kwargs):
+    """Emulate the API of appsupport.pypyraises."""
+    __tracebackhide__ = True
+    return py.test.raises(*args, **kwargs)._excinfo
+
+def ensure_pytest_builtin_helpers(helpers='skip'.split()):
     """ hack (py.test.) raises and skip into builtins, needed
         for applevel tests to run directly on cpython but 
         apparently earlier on "raises" was already added
         to module's globals. 
     """ 
     import __builtin__
+    if not hasattr(__builtin__, "raises"):
+        __builtin__.raises = _pytest_raises_wrapper
     for helper in helpers: 
         if not hasattr(__builtin__, helper):
             setattr(__builtin__, helper, getattr(py.test, helper))



More information about the Pypy-commit mailing list