nvim-neotest / neotest-python

MIT License
126 stars 38 forks source link

feat(pytest): exception breakpoints when running with dap strategy #25

Closed wookayin closed 1 year ago

wookayin commented 1 year ago

Implements and Fixes #23.

Summary

When running neotest with the DAP strategy (nvim-dap), we make the pydebug debugger stop at "exception breakpoints" where the exception is thrown out of a pytest method.

This will be very helpful for users to debug failing unit tests.

Tested scenarios

require("neotest").run.run({ strategy = "dap" })

image

require("neotest").run.run()

Notes and/or TODOs

~Please do not merge yet until #24 is merged.~ #24 is done, rebased.

rcarriga commented 1 year ago

Very nice :grin: Appreciate you investigating the issue and opening a PR! As far as I can see it looks good to go, but I'll need to see it rebased/merged with the merged PR to confirm

wookayin commented 1 year ago

Rebased to origin/master.

Having the debugger paused at exception breakpoints could be configurable

I think this default behavior is just fine, assuming it's desired because users would run it explicitly with { strategy = 'dap' }.

So at this point I do not have anything to add. Feel free to test on your side to see if it works. Any other review comments would be also appreciated.

rcarriga commented 1 year ago

I think this default behavior is just fine, assuming it's desired because users would run it explicitly with { strategy = 'dap' }.

Sorry missed this question, yes I think that makes perfect sense so I'm happy to leave it as is :+1:

No comments from me, appreciate all of the typing and docs! Thanks again :smile: