nvim-neotest / neotest-python

MIT License
116 stars 34 forks source link

pytest: use pytest_runtest_makereport for consistent exception handling #29

Closed OddBloke closed 1 year ago

OddBloke commented 1 year ago

The report passed to pytest_runtest_logreport has a different internal exception representation depending on the --tb option with which pytest is configured: some of these representations do not include the traceback frames to allow us to calculate line numbers.

pytest_runtest_makereport, however, has access to the original ExceptionInfo object when an exception is raised: this commit switches to using a pytest_runtest_makereport hookwrapper, so we can access the pytest-generated report as before, but get exception handling independent of --tb setting.

Fixes: #28

rcarriga commented 1 year ago

LGTM! Thanks for the the PR(s) :grinning:

OddBloke commented 1 year ago

LGTM! Thanks for the the PR(s) grinning

Thanks for the speedy responses, and for landing! As a reward, I've opened two more PRs :grin: