当前位置: 首页> 技术文章> Pytest单元测试框架之测试报告

Pytest单元测试框架之测试报告

1、pytest-html 生成测试报告

  • 安装 pytest-html

pip install pytest-html
  • cmd 下执行用例且生成报告

  • 代码中生成测试报告

import pytest

def test_01():    
    print("深圳多测师")

def test_02():    
    print("广州多测师")

def test_03():        
    print("上海多测师")

if __name__ == '__main__':
# --html=report.html 生成测试报告,也可以自定义报告路径如:--html=d://report.html
    pytest.main(["-q","test_demo1.py","--html=report.html"])

 

上一篇: 测试人员的成长之路

下一篇: 软件测试之手工测试人员如何转测试开发?

QQ技术交流群

多测师官方学习交流
556733550

加入群聊