I\'m trying to write a simple unit test that will verify that, under a certain condition, a class in my application will log an error via the standard logging API. I can\'t
Fortunately this is not something that you have to write yourself; the testfixtures package provides a context manager that captures all logging output that occurs in the body of the with statement. You can find the package here:
http://pypi.python.org/pypi/testfixtures
And here are its docs about how to test logging:
http://testfixtures.readthedocs.org/en/latest/logging.html