unittest generate reports

# Html report file path
    report_abspath = os.path.join (report_path, "result.html")
    fp = Open (report_abspath, "wb")
    Runner = HTMLTestRunner.HTMLTestRunner (fp = Stream,
                                           title = U 'automated test reports, test The results are as follows: ',
                                           Description = U' with the implementation of Example: ')

    # call function return value add_case
    runner.run (all_case ())
    fp.close ()

Guess you like

Origin www.cnblogs.com/yaohu/p/11593419.html