In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly shows you the "sample analysis of HTML test reports in python", which is easy to understand and well-organized. I hope it can help you solve your doubts. Let me lead you to study and study the "sample analysis of HTML test reports in python".
Description
1. Copy the file to the project directory.
2. Import the module into the code.
From HTMLTestRunner import HTMLTestRunner
3. Call HTMLTestRunner.
(stream=file, title = my first html test report)
4. Open the file with open.
The open file name extension must be .html.
5. Use wb when opening files.
There is no need to specify a character set.
6. Execute the test suite.
Call the run method of the runner object
7. Close the file that opens open.
Example
Import unittestfrom HTMLTestRunner import HTMLTestRunner# uses the discover method of the TestLoader object to automatically find py, and automatically loads the method # in the py file. The first parameter is where to find the py file, "." Find the py file from the current directory # the second parameter is to specify the file name of the py file. You can use the wildcard character suite = unittest.TestLoader () .discover (".", "my*.py") # runner = unittest.TextTestRunner () file = open ("test01.html", "wb") # open the file # runner = unittest.TextTestRunner (stream=file, verbosity=2) runner = HTMLTestRunner (stream=file) in binary writing with wb. Title= "my first html test report") runner.run (suite) file.close () # demo08 module (demo08.py file) import unittestfrom parameterized import parameterized def digital (str1): sum = 0 for n in str1: if n > ='0' and n
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.