Vinay Sajip added the comment: I agree a context manager would be useful. Note that I have already provided a Handler subclass (TestHandler) as well as a Matcher class which allows matching of LogRecords, and which can be used in assertions. These are in test.support as they were originally intended for Python's own tests, but could be moved to the logging package if they are considered more generally useful.
See this for how to use them: http://plumberjack.blogspot.co.uk/2010/09/unit-testing-and-logging.html ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue18937> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com