Robert Collins added the comment: Ok so, design thoughts here.
assertLogs really does two things. Firstly it takes a copy of the logs so it can do its assertion. Secondly it disables all other logging, cleaning up noisy tests. Your specific need only conflicts with the second case. The way I handle this in 'fixtures' is to automatically attach the logs to the test output, which means failures show the logs. (Successes have them too, but they are not shown by default). Ignoring the mismatch between stock unittest and fixtures supporting unittests, does this sound like it would meet your needs? e.g. you'd use your global to make attachments be shown on success as well as failure, and then you'd have nearly identical behaviour. But not exactly: it would still disable the during-execution output (which makes parallel and CI runs a lot nicer - the report at the end is the key). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24352> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com