pytest 生成测试报告

安装依赖

bash 复制代码
pip  install  allure-pytest
pip  install  pytest
pip  install  pytest-html
pip  install  requests

配置 allure

bash 复制代码
下载 allure  并配置环境变量
D:\allure-2.28.0\bin
 配置到 path

执行脚本

bash 复制代码
在项目根目录创建  pytest.ini

配置如下
[pytest]
#  指定  生成 报告的目录
addopts = -s --alluredir=./report
# 脚本 位置
testpaths = ./script
# 测试脚本名称
python_files = *.py
python_classes = Test*
python_functions = test*

生成测试报告

bash 复制代码
# 生成报告 
allure generate ./report -o report/html
# 运行报告 站点
allure open -h 127.0.0.1 -p 8088 report/html
相关推荐
Crazy________17 小时前
40nginx从单节点 HTTPS 到集群负载均衡
linux·运维·服务器
咖啡の猫18 小时前
搭建Python开发环境
开发语言·python
听风吟丶20 小时前
Java 8 Stream API 高级实战:从数据处理到性能优化的深度解析
开发语言·python
悟空码字20 小时前
部署Spring Boot项目到Linux服务器数据盘
linux·spring boot·部署·数据盘
文人sec21 小时前
pytest1-接口自动化测试场景
软件测试·python·单元测试·pytest
Once_day1 天前
Linux之rsyslog(6)RainerScript
linux·服务器·syslog
Shylock_Mister1 天前
Linux C线程编程全指南
linux·运维·c语言
secondyoung1 天前
Mermaid流程图高效转换为图片方案
c语言·人工智能·windows·vscode·python·docker·流程图
心灵宝贝1 天前
CentOS 7 安装 unzip-6.0-21.el7.x86_64.rpm 步骤详解(附安装包)
linux·服务器·centos
q***13341 天前
在linux(Centos)中Mysql的端口修改保姆级教程
linux·mysql·centos