You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since pytest supports the --pdb and --pdbcls switches to launch a debugger if a test assertion fails:
--pdb start the interactive Python debugger on errors or
KeyboardInterrupt.
--pdbcls=modulename:classname
start a custom interactive Python debugger on errors.
For example:
--pdbcls=IPython.terminal.debugger:TerminalPdb
it could be useful (at least to me) if debugpy could support this. See emacs-lsp/dap-mode#506
I may be wrong but it looks like debugpy (and vscode) do not support this yet.
Adding this directly in debugpy could be easier than grafting it onto a pytest plugin, as I proposed in emacs-lsp/dap-mode#506
As a note, for pytest it's not the Uncaught exceptions (because the exceptions are actually caught by pytest), instead, you want the User Uncaught Exceptions -- in this case it's not available by default, but it should appear to you if you set an environment variable such as DEBUGPY_EXCEPTION_FILTER_USER_UNHANDLED=1 and make a launch in VSCode -- when the client will update the exceptionBreakpointFilters.
Karthik Nadig (@karthiknadig)Pavel Minaev (@int19h) maybe it's time to remove the need for the DEBUGPY_EXCEPTION_FILTER_USER_UNHANDLED environment variable to enable this handling? -- reopening to check whether this should be done...
I think the User Uncaught Exceptions breakpoint mode is not enough for implementing post-mortem mode, because it will pause too aggressively at exceptions that regularly crosses the boundaries between user and library code (see #1102 for more details). I wrote a feature request in #1103.
Activity
fabioz commentedon Sep 13, 2021
This is already available (in
debugpyit's theUncaught exceptionsbreakpoint).fabioz commentedon Sep 13, 2021
As a note, for pytest it's not the
Uncaught exceptions(because the exceptions are actually caught by pytest), instead, you want theUser Uncaught Exceptions-- in this case it's not available by default, but it should appear to you if you set an environment variable such asDEBUGPY_EXCEPTION_FILTER_USER_UNHANDLED=1and make a launch in VSCode -- when the client will update theexceptionBreakpointFilters.Karthik Nadig (@karthiknadig) Pavel Minaev (@int19h) maybe it's time to remove the need for the
DEBUGPY_EXCEPTION_FILTER_USER_UNHANDLEDenvironment variable to enable this handling? -- reopening to check whether this should be done...int19h commentedon Sep 21, 2021
Yep, we decided to enable the option with the current wording.
fabioz commentedon Sep 23, 2021
It seems like #724 is tracking that (so, I'm closing this issue).
wookayin commentedon Oct 26, 2022
I think the
User Uncaught Exceptionsbreakpoint mode is not enough for implementing post-mortem mode, because it will pause too aggressively at exceptions that regularly crosses the boundaries between user and library code (see #1102 for more details). I wrote a feature request in #1103.wookayin commentedon Oct 27, 2022
See #723 as well to make debugpy handle an thrown exception