提交 bf4c3143 编写于 作者: L Lukáš Doktor

avocado.core.test: Use self.log rather than stacktrace.log_message

The use of stacktrace.log_message is not really necessary as the test
already has `self.log` which is the actual log we want to write to.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 700c3608
...@@ -453,12 +453,10 @@ class Test(unittest.TestCase): ...@@ -453,12 +453,10 @@ class Test(unittest.TestCase):
if not isinstance(details, Exception): # Avoid passing nasty exc if not isinstance(details, Exception): # Avoid passing nasty exc
details = exceptions.TestError("%r: %s" % (details, details)) details = exceptions.TestError("%r: %s" % (details, details))
test_exception = details test_exception = details
stacktrace.log_message('Local variables:', logger='avocado.test') self.log.debug("Local variables:")
local_vars = inspect.trace()[1][0].f_locals local_vars = inspect.trace()[1][0].f_locals
for key, value in local_vars.iteritems(): for key, value in local_vars.iteritems():
stacktrace.log_message(' -> %s %s: %s' self.log.debug(' -> %s %s: %s', key, type(value), value)
% (key, type(value), value),
logger='avocado.test')
finally: finally:
try: try:
self.tearDown() self.tearDown()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册