1、安装pytest-html
使用命令pip install pytest-html -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com来安装pytest-html
官方文档地址:pytest-html官方链接
2、书写pytest测试用例
书写测试用例文件Test_simple.py:
#-*- coding: utf-8 -*-
import pytest
class Test_simple():
def test_case1(self):
tof =

本文介绍了如何安装和使用pytest-html插件来生成pytest测试的HTML报告。首先通过命令行安装pytest-html,然后书写pytest测试用例,最后运行测试用例并生成一个包含CSS样式的独立HTML报告。
最低0.47元/天 解锁文章
5305





