[pypy-commit] pypy default: Redo a6099e49c9ec: Add option --raise-operr to pytest that shows the interp-level OperationError when an app-level test fails.

mjacob noreply at buildbot.pypy.org
Wed Feb 25 12:29:36 CET 2015


Author: Manuel Jacob <me at manueljacob.de>
Branch: 
Changeset: r76126:a910c6548369
Date: 2015-02-25 12:29 +0100
http://bitbucket.org/pypy/pypy/changeset/a910c6548369/

Log:	Redo a6099e49c9ec: Add option --raise-operr to pytest that shows the
	interp-level OperationError when an app-level test fails.

	This commit was backed out in 1ec5a5fa19da and redone differently
	previously in 96036c3af238, which itself was reverted in
	c195a8bc4ff5.

diff --git a/pypy/conftest.py b/pypy/conftest.py
--- a/pypy/conftest.py
+++ b/pypy/conftest.py
@@ -36,7 +36,7 @@
 def pytest_addoption(parser):
     from rpython.conftest import pytest_addoption
     pytest_addoption(parser)
-    
+
     group = parser.getgroup("pypy options")
     group.addoption('-A', '--runappdirect', action="store_true",
            default=False, dest="runappdirect",
@@ -44,6 +44,9 @@
     group.addoption('--direct', action="store_true",
            default=False, dest="rundirect",
            help="run pexpect tests directly")
+    group.addoption('--raise-operr', action="store_true",
+            default=False, dest="raise_operr",
+            help="Show the interp-level OperationError in app-level tests")
 
 def pytest_funcarg__space(request):
     from pypy.tool.pytest.objspace import gettestobjspace
diff --git a/pypy/tool/pytest/apptest.py b/pypy/tool/pytest/apptest.py
--- a/pypy/tool/pytest/apptest.py
+++ b/pypy/tool/pytest/apptest.py
@@ -35,8 +35,8 @@
         try:
             target(*args)
         except OperationError, e:
-            #if self.config.option.verbose:
-            #    raise
+            if self.config.option.raise_operr:
+                raise
             tb = sys.exc_info()[2]
             if e.match(space, space.w_KeyboardInterrupt):
                 raise KeyboardInterrupt, KeyboardInterrupt(), tb


More information about the pypy-commit mailing list