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