我有一套测试服被HTMLRunner破坏了:
if __name__ == '__main__':
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(MyForms))
dateTimeStamp = time.strftime('%Y%m%d_%H_%M_%S')
buf = file("../TestReport" + "_" + dateTimeStamp + ".html", 'wb')
runner = HTMLTestRunner.HTMLTestRunner(
stream = buf,
title = 'PDFFiller tests', # Title of report
description = 'Test results' # Description of report
)
runner.run(suite)
如果测试失败,如何升级代码以再次运行测试?在
注意:我听说运行两次测试是不对的,但我需要重新运行它。在
始终可以尝试将测试另存为函数,并使用try/except在循环中运行它。try/except将允许您在失败后继续。循环将允许您控制运行测试的次数。在
相关问题 更多 >
编程相关推荐