Install Htmltestrunner under Mac

Source: Internet
Author: User

Htmltestrunner is an extension of the Python standard library unittest module. It generates easy-to-use HTML test reports.

1. Download htmltestrunner.py module Address

Http://tungwaiyip.info/software/HTMLTestRunner.html

2. There are several ways to import modules, where we place modules in Python's third-party non-standard module library

Mac under Python third-party nonstandard module library location:/library/python/2.7/site-packages

3. Create a new Htmltestrunner folder and create a new empty __init__.py file under the folder so that the folder Htmltestrunner becomes a package that can be imported and then put the htmltestrunner.py into the folder.

4. Now you can use the Htmltestrunner module

#Coding=utf-8ImportUnitTest fromTest_caseImportTest_baidu fromHtmltestrunnerImportHtmltestrunner#Constructing test SetsSuite =UnitTest. TestSuite () suite.addtest (Test_baidu. MyTest ("Test_baidu"))if __name__=='__main__':    " "the use case runner = UnitTest is not performed using Htmltestrunner. Texttestrunner () Runner.run (suite)" "    #define a report storage pathfp = open ('./report/result.html','WB') Runner= Htmltestrunner.htmltestrunner (stream=fp,title=u'Baidu Search test Report', Description=u'use case execution:') Runner.run (Suite) fp.close ()

Install Htmltestrunner under Mac

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.