1、测试报告生成案例
2、测试报告生成代码
1 # -*- coding: UTF-8 -*-
2 """
3 A TestRunner for use with the Python unit testing framework. It
4 generates a HTML report to show the ...
import jsonfrom random import sample, randintfrom uuid import uuid4def gen_random_words(): with open("D:\\exp\\test_data\\dictionary.txt") as f: words = [word.strip() for word in f] f...
pip安装
pip install pytest-html
编写脚本
import pytest
class TestClass(object):
def test_one(self):
x = "this"
assert 'h' in x
def test_two(self):
x = "hello"
...