-
Notifications
You must be signed in to change notification settings - Fork 62
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
LogCapture breaks ipdb #207
Comments
I saw this recently too, while debugging a test that was using I didn't have a chance to dig into what was going on and just commented-out the |
@bromatofiel - @asqui - what's the traceback for the situation you encountered? What's PyCharm using under the hood? |
@asqui - can you remember the reason for this commit? I have a feeling it was related to a gotcha in the codebase you're working on, but it's not recorded in an issue or commit message here :-/ |
@cjw296 I don't know why It doesn't explain why they reconfigure the loggers during runtime, but it seems it has something to do with changing the existing logger levels. |
My traceback is materially the same: I suspect the motivation for the change in 2686329 (to fail loudly if the For that scenario "fail loudly" seems desirable, but for the "IPython in the debugger" scenario, not so much 😢 |
It feels like the pragmatic thing to do here is to change this exception to be a warning. That way, you'll hopefully see the warning when debugging, and so know that the debugger has trashed your log capturing, but will be able to continue. If suitably paranoid, CI runs could be configured to turn this warning into an exception. Do you both agree with this course of action? |
Seems reasonable. I’m slightly worried that the exception might go unseen, but I don’t have any better suggestions. |
If you have a warning filter turn this warning into an exception, it'll blow up in exactly the same way it does with the current code, I think? |
Hello,
Thank you for LogCapture, I'm using it by default during all my tests to hide spam and displays errors only if a test fails. Very helpful!
But with release 8.3.0, I can't use
ipdb
anymore due to LogCapture.close() raising AssertionError('LogCapture instance closed while still installed').Here is a minimalist way to reproduce:
And here is the trace:
There was no problem before. If this is not the right way to use it, please feel free to tell!
Best regards.
The text was updated successfully, but these errors were encountered: