address reviewer comments
This commit is contained in:
parent
0fc75c9622
commit
a9b7de8bf0
|
@ -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()``
|
||||||
----------------------------------------------------
|
----------------------------------------------------
|
||||||
|
|
|
@ -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):
|
||||||
|
|
Loading…
Reference in New Issue