mfussenegger / nvim-dap-python

An extension for nvim-dap, providing default configurations for python and methods to debug individual test methods or classes.
GNU General Public License v3.0
532 stars 48 forks source link

debugging pytest with playwright subprocess fails #152

Open orenherman opened 1 month ago

orenherman commented 1 month ago

hi all, i have a big complex test suite based on pytest that launches a browser and orchestrates it with playwright currently my settings for nvim-dap are:

{
  runner = 'pytest',
  python = '/Users/orenherman/.virtualenvs/debugpy/bin/python',
  dap = {
    python = { '-Xfrozen_modules=off', '--multiprocess', '--qt-support=auto' },
    console = 'integratedTerminal',
    justMyCode = false,
    stopOnEntry = true,
    subProcess = true,
  },
}

i can set breakpoints in the different entry points and it'll catch them, but once set inside the subprocess that orchestrates the browser (the actual test) - it will skip those and disconnect the debugger. i know this must be a debugpy issue (although i do manage to debut the subprocesses in vscode) but i wonder if i can get some guidance please? ** worth noting, that debugging with subProcess = false or just running the test works just fine ill try and post a small repo with playwright and pytest to reproduce

orenherman commented 1 month ago

possible workaround - setting the pytest --numprocesses to 1, will result in 1 and the debugger will catch the breakpoint.

mfussenegger commented 1 week ago

Would need a minimal reproduction.