PEP-415 states that `exception.__context__` should be suppressed in traceback outputs, if `exception.__suppress_context__` is `True`. Now if a ``raise exception from None`` is caught by pytest, pytest will no longer chain the context in the test report. The algorithm in `FormattedExcinfo` now better matches the one in `traceback.TracebackException`. `Exception.__suppress_context__` is available in all of the versions of Python 3 that are supported by pytest. Fixes #2631. |
||
|---|---|---|
| .. | ||
| test_code.py | ||
| test_excinfo.py | ||
| test_source.py | ||
| test_source_multiline_block.py | ||