我正在运行nosetests用这样的计时器模块:获取测试结果
import nose
from nosetimer import plugin
from collections import defaultdict
import time
import pandas as pd
plugin = plugin.TimerPlugin()
plugin.enabled = True
plugin.timer_ok = 1000
plugin.timer_warning = 2000
plugin.timer_no_color = False
logList = defaultdict(list)
nose.run(plugins=[plugin])
result = plugin._timed_tests
for test in result:
logList[test].append(result[test])
,我想知道是否有可能让每个测试名的映射传递/失败/错误是这样的:
{
'example.file.path.test1': 'pass',
'example.file.path.test2': 'pass',
'example.file.test3': 'fail',
'example.file.test4': 'pass',
'example.file.path2.test5': 'error',
'example.file.path2.test6': 'pass'
}
但没有读取标准输出。换句话说,有没有一个位置可以存储这些信息?我一直在阅读文档和代码几个小时没有运气,所以我觉得我可能会错过一些东西。
我知道我可以用插件做,但我希望有一个更简单的方法来获得这些结果。如果可能的话,我想单独离开setup.py。 – weskpga
我非常肯定,如果有什么工作,它将是一个无证的破解,这意味着你必须自己的代码。 –
无证黑客是要走的路。 – weskpga