I have a lot of unit tests in Django and if a test fails, I often need to see the logs (in the console, if possible). I can't really use the log file because it gets really messy.
What I do right now is: activate console logging in the settings.py
, and only run one specific test. I was hoping that there is a more convenient way to do it. I only want to see what was being logged for the failing tests and not the complete log.
Edit: even though an answer was posted — and I have accepted it — I'm not quite content. I want to see only the logging output of failing tests. I was looking for a solution like that which PHPUnit provides. It captures the complete output (for logging + print) and only writes it to stdout
if the test fails.