-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Print captured logs before entering pdb #3204
Comments
@nicoddemus @Thisch So do you think we should still print captured logs at the end when live logging is on? It seems to me that as long as we capture something we should print it. Live logging is in addition to capturing, because if it's on we get the logs as they happen and also in the report if the test fails. I think the behavior before entering the debugger should parallel the failed test report. |
I have some long running tests, which output a lot of log messages when I debug them. For debugging I use live-logging and For me it does not make sense to show the captured logs before entering pdb, since 1) the captured logs are not colored. IMO the captured logs are not as readable as the colored live-logs (see #3142). For the test reports it is possible to disable the printing of caught logs on failure ( It might make sense to only display the captured logs before entering pdb when WDYT? |
Sounds good, I'll modify it to take into consideration the |
Thanks @Thisch for the explanation, indeed it makes sense to consider |
@Thisch I think this should go in a separate issue, would you mind opening it? Thanks! |
Given that we've merged #3234, we can close this issue. |
Extension of PR #3186 for the caplog feature.
When a test fails and we are about the enter the debugger, we first print the traceback and the captured stdout and stderr. We need to add the captured logs. This is being opened as a separate ticket because caplog was added in the features branch, so if this issue is fixed before it gets merged, target the features branch for this issue as well.
See discussion here: https://github.com/pytest-dev/pytest/pull/3186/files#r166777807
The text was updated successfully, but these errors were encountered: