-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Debugger instance already exists" when used in pytest #607
Comments
Why not use |
I thought from the documentation the new way was just adding a few options instead of having to install it. |
Actually, it's not working very well either. After installing it and running It works fine with pytest-pudb installed (else it fails) and then running |
Try without the |
I can't reproduce with 2
And running with the same command:
I expect to see this instead (here I pressed already The issue can be fixed by commenting these two lines here:
But I assume that this fix is too dirty to be committed... yet I don't understand why this check is needed, for me it works fine (better) without it. |
…during postmortem. This fixes inducer#607. Making the Debugger a singleton should be enough to fix inducer#607. HOWEVER, pytest def postmortem() calls .reset() which reset the stopframe. Somehow, this causes the debugger to stop somewhere inside internal debugger source code, instead of in the code the postmortem should be done. So, this also includes an overrid eof the .reset() method and detects when the debugger is already running and does not reset the stopframe. See also inducer#67.
…during postmortem. This fixes inducer#607. Making the Debugger a singleton should be enough to fix inducer#607. HOWEVER, pytest def postmortem() calls .reset() which resets the stopframe. Somehow, this causes the debugger to stop somewhere inside internal debugger source code, instead of in the code the postmortem should be done. So, this also includes an override of the .reset() method and detects when the debugger is already running and does not reset the stopframe. See also inducer#67.
Describe the bug
When 2 breakpoints are encountered in pytest with pudb set up, this error pops: Debugger instance already exists
To Reproduce
Steps to reproduce the behavior:
test.py
pytest --pdbcls pudb.debugger:Debugger --pdb --capture=no test.py
(following https://documen.tician.de/pudb/starting.html#usage-with-pytest)c
to continue to second oneExpected behavior
The debugger should be called on second breakpoint
Versions
pudb 2022.1.3
The text was updated successfully, but these errors were encountered: