2024-04-29 09:14:13 发布
网友
我无法重新运行失败的python webdriver测试。我使用unittest执行测试。在
已尝试使用flaky但未成功。在
能够解决这个问题。在
下面是相同的示例代码:
import HTMLTestRunner import os import unittest def testsuite(): suite = unittest.TestSuite() suite.addTest("Add your test here") return suite reportloc = os.getcwd() outfile = open(reportloc + "TestReport.html", "w") executor = HTMLTestRunner.HTMLTestRunner(stream=outfile, title="Test Report", description="Tests") envresult = executor.run(testsuite()) if envresult.error_count >= 1 or envresult.failure_count >= 1: executor.run(testsuite())
如果测试用例中有一个失败或错误,测试套件将再次执行。在
能够解决这个问题。在
下面是相同的示例代码:
如果测试用例中有一个失败或错误,测试套件将再次执行。在
相关问题 更多 >
编程相关推荐