address reviewer comments

This commit is contained in:
Almar Klein 2015-03-21 17:26:23 +01:00
parent 0fc75c9622
commit a9b7de8bf0
2 changed files with 14 additions and 3 deletions

View File

@ -88,8 +88,16 @@ failure situation::
py.test --pdb --maxfail=3 # drop to PDB for first three failures py.test --pdb --maxfail=3 # drop to PDB for first three failures
Note that on any failure the exception information is stored on Note that on any failure the exception information is stored on
``sys.last_traceback``. In interactive use, this allows one to drop ``sys.last_value``, ``sys.last_type`` and ``sys.last_traceback``. In
into postmortem debugging with any debug tool. interactive use, this allows one to drop into postmortem debugging with
any debug tool. One can also manually access the exception information,
for example::
>> import sys
>> sys.last_traceback.tb_lineno
42
>> sys.last_value
AssertionError('assert result == "ok"',)
Setting a breakpoint / aka ``set_trace()`` Setting a breakpoint / aka ``set_trace()``
---------------------------------------------------- ----------------------------------------------------

View File

@ -527,7 +527,10 @@ def test_makereport_getsource(testdir):
result.stdout.fnmatch_lines(['*else: assert False*']) result.stdout.fnmatch_lines(['*else: assert False*'])
def test_store_except_info_on_eror(testdir): def test_store_except_info_on_eror():
""" Test that upon test failure, the exception info is stored on
sys.last_traceback and friends.
"""
# Simulate item that raises a specific exception # Simulate item that raises a specific exception
class ItemThatRaises: class ItemThatRaises:
def runtest(self): def runtest(self):