Python 3: enable tests/unit/test_log.py
Change-Id: I2ae861b73cf32c4f732a31ae93f7a86b05890fbb
This commit is contained in:
@@ -244,6 +244,11 @@ class LazyAdapter(BaseLoggerAdapter):
|
||||
def logger(self):
|
||||
if not self._logger:
|
||||
self._logger = getLogger(self.name, self.version)
|
||||
if six.PY3:
|
||||
# In Python 3, the code fails because the 'manager' attribute
|
||||
# cannot be found when using a LoggerAdapter as the
|
||||
# underlying logger. Work around this issue.
|
||||
self._logger.manager = self._logger.logger.manager
|
||||
return self._logger
|
||||
|
||||
|
||||
@@ -397,7 +402,7 @@ def _load_log_config(log_config_append):
|
||||
try:
|
||||
logging.config.fileConfig(log_config_append,
|
||||
disable_existing_loggers=False)
|
||||
except moves.configparser.Error as exc:
|
||||
except (moves.configparser.Error, KeyError) as exc:
|
||||
raise LogConfigError(log_config_append, six.text_type(exc))
|
||||
|
||||
|
||||
|
||||
@@ -630,7 +630,7 @@ class LogConfigOptsTestCase(test_base.BaseTestCase):
|
||||
|
||||
class LogConfigTestCase(test_base.BaseTestCase):
|
||||
|
||||
minimal_config = """[loggers]
|
||||
minimal_config = b"""[loggers]
|
||||
keys=root
|
||||
|
||||
[formatters]
|
||||
|
||||
Reference in New Issue
Block a user