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

avocado.core.test: Log type when listing local vars

It could be useful to see not only key/value pairs, but also their
types. As the value could be pretty long this patch logs the type just
after the key.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 3e61b6ce
......@@ -456,7 +456,8 @@ class Test(unittest.TestCase):
stacktrace.log_message('Local variables:', logger='avocado.test')
local_vars = inspect.trace()[1][0].f_locals
for key, value in local_vars.iteritems():
stacktrace.log_message(' -> %s: %s' % (key, value),
stacktrace.log_message(' -> %s %s: %s'
% (key, type(value), value),
logger='avocado.test')
finally:
try:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册