Closed
Description
Originally reported by: Vyacheslav Rafalskiy (BitBucket: s4g, GitHub: s4g)
In some use cases, especially in functional testing, the pytest_configure(), pytest_sessionstart() and other hooks can be loaded with heavy setup code, which can fail in many different ways. If exceptions in such code are reinterpreted, as is the case in pytest 2.0.2, the important pre-formatted messages and traces are lost, or at least disfigured by long listings with every line prepended with 'INTERNALERROR>'.
It is desirable to be able to avoid such reinterpretation with a command-line option or other means.
Presently, I use the following monkey-patch as a workaround:
#!python
import sys, _pytest.core
def _notify_exception(self, excinfo):
excrepr = excinfo.getrepr(style='native')
sys.stderr.write(excrepr)
_pytest.core.PluginManager.notify_exception = _notify_exception