Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Print captured logs before entering pdb #3204
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
referenced this issue
Feb 10, 2018
@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