如何为python pytest测试创建自定义测试报告(csv或excel格式)

时间:2018-04-23 04:46:19

标签: python-2.7 pytest

我正在使用pytest用以下命令运行我的测试,报告以html格式生成。我在conftest.py中使用了hookwrapper来进行html报告。

Code to run the test :
py.test --html=report.html --self-contained-html test.py

我想知道是否有办法使用python pytest以csv或excel格式生成自定义报告

1 个答案:

答案 0 :(得分:0)

从我的其他answer

  

我一直在使用pytest-excel插件生成xls文件报告。

     

用法:

     

pip安装pytest-excel

     

pytest --excelreport = report.xls

     

它将生成report.xls excel文件。