From: Ben Darnell Date: Mon, 16 Aug 2010 01:11:48 +0000 (-0700) Subject: In LogTrapTestCase, leave everything alone rather than throwing an exception X-Git-Tag: v1.1.0~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=221058e1cb9d8b424efd5b6af40768537f26060c;p=thirdparty%2Ftornado.git In LogTrapTestCase, leave everything alone rather than throwing an exception if the logging config is not as expected. --- diff --git a/tornado/testing.py b/tornado/testing.py index ec25d5c96..d39d3c636 100644 --- a/tornado/testing.py +++ b/tornado/testing.py @@ -246,6 +246,12 @@ class LogTrapTestCase(unittest.TestCase): """ def run(self, result=None): logger = logging.getLogger() + if len(logger.handlers) > 1: + # Multiple handlers have been defined. It gets messy to handle + # this, especially since the handlers may have different + # formatters. Just leave the logging alone in this case. + super(LogTrapTestCase, self).run(result) + return if not logger.handlers: logging.basicConfig() self.assertEqual(len(logger.handlers), 1)