提交 f4b83025 编写于 作者: A Amador Pahim 提交者: GitHub

Merge pull request #1471 from ldoktor/local_variables

avocado: Few little improvements to listing local vars
......@@ -453,11 +453,10 @@ class Test(unittest.TestCase):
if not isinstance(details, Exception): # Avoid passing nasty exc
details = exceptions.TestError("%r: %s" % (details, 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
for key, value in local_vars.iteritems():
stacktrace.log_message(' -> %s: %s' % (key, value),
logger='avocado.test')
self.log.debug(' -> %s %s: %s', key, type(value), value)
finally:
try:
self.tearDown()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册