[py-dev] New issue 118 in py-trunk: native traceback option

issues-noreply at bitbucket.org issues-noreply at bitbucket.org
Tue Sep 7 17:02:27 CEST 2010


--- you can reply above this line ---

New issue 118: native traceback option
http://bitbucket.org/hpk42/py-trunk/issue/118/native-traceback-option

nikow on Tue, 7 Sep 2010 17:02:27 +0200:

Description:
  I'm using Eclipse with PyDev and when running unittest this allows me to click on the traceback information to directly jump to the code. For py.test when called from the IDE this does not work, since apparently PyDev relies on the standard traceback format to make it clickable.

Therefore it would be great if a --tb option was added to display tracebacks in the native formatting.

For now I fixed this by inserting the following code in collect.py in line 177:
{{{
import traceback
tb_strs = traceback.format_tb(excinfo._excinfo[2])
i = 0
while not tb_strs[i].endswith("    testfunction(**funcargs)\n"):
    i += 1
tb_strs = tb_strs[i+1:]
return "\n" + "".join(tb_strs) + "\n"
}}}

On a side note: I'm currently use {{{py.test.cmdline.main(...)}}} to run py.test from inside the IDE. Maybe one could add some "offical" API to call py.test in this way.

Thanks.

Responsible:
  hpk42
-- 
This is an issue notification from bitbucket.org.
You are receiving this either because you are the
owner of the issue, or you are following the issue.



More information about the Pytest-dev mailing list