Skip to content

Support post_mortem debugging #722

Closed

Description

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

Activity

  1. fabioz commented on Sep 13, 2021

    @fabioz
    Collaborator

    This is already available (in debugpy it's the Uncaught exceptions breakpoint).

  2. fabioz commented on Sep 13, 2021

    @fabioz
    Collaborator

    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...

  3. int19h commented on Sep 21, 2021

    @int19h
    Contributor

    Yep, we decided to enable the option with the current wording.

  4. fabioz commented on Sep 23, 2021

    @fabioz
    Collaborator

    It seems like #724 is tracking that (so, I'm closing this issue).

  5. wookayin commented on Oct 26, 2022

    @wookayin

    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.

  6. wookayin commented on Oct 27, 2022

    @wookayin

    See #723 as well to make debugpy handle an thrown exception

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions