-
Notifications
You must be signed in to change notification settings - Fork 190
Description
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
This is something that I use quite often so I would appreciate if dap-python could support it in some way.
Briefly glancing at the debugpy documentation and experimenting a bit it turns out that pytest tries to run the post_mortem
method of that class https://docs.python.org/3/library/pdb.html#pdb.post_mortem which debugpy and its predecessor apparently do not support.
I think there may be some way to accomplish this with the current traceback and introspection and a custom class in python, but more reading and experimenting is necessary.
To elaborate: I think this could be done with a pytest plugin, which might be out of scope for dap-python, but I'm not sure what kind of support would be needed on dap-python's side.