From 221058e1cb9d8b424efd5b6af40768537f26060c Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Sun, 15 Aug 2010 18:11:48 -0700 Subject: [PATCH] In LogTrapTestCase, leave everything alone rather than throwing an exception if the logging config is not as expected. --- tornado/testing.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tornado/testing.py b/tornado/testing.py index ec25d5c9..d39d3c63 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)