unittest HTMLTestRunner HTMLTestRunner time (unittest.TestCase): (): () (): () (): () (): () __name__ == : suite=unittest.TestSuite() suite.addTest(Test()) suite.addTest(Test()) now=time.strftime() filename=+ now +fp=(filename) runner = HTMLTestRunner(=fp= = ) runner.run(suite) fp.close() 转载于:https://blog.51cto.com/357712148/1983174