千家信息网

1个练习引发的系列学习之pytest生成测试报告 (三)

发表于:2025-02-10 作者:千家信息网编辑
千家信息网最后更新 2025年02月10日,一、背景介绍pytest提供了生成报告的功能。使用pytest --help可以进行查看。二、 生成测试报告-v 显示详情-q 只显示汇总信息-r 用chars标识用例执行结果,(f)ailed, (
千家信息网最后更新 2025年02月10日1个练习引发的系列学习之pytest生成测试报告 (三)

一、背景介绍
pytest提供了生成报告的功能。
使用pytest --help可以进行查看。

二、 生成测试报告

  • -v 显示详情

  • -q 只显示汇总信息

    -r 用chars标识用例执行结果,(f)ailed, (E)error, (s)skipped, (x)failed, (X)passed, (p)passed, (P)passed with output, (a)all except pP.

    --disable-warning ,disable warnings summary

    -l ,show locals in tracebacks (disabled by default)

--tb=style,traceback print mode (auto/long/short/line/native/no).
--tb=no

--full-trace don't cut any tracebacks (default is to cut).

--color=color color terminal output (yes/no/auto).
--color=no

--junit-xml=path , create junit-xml style report file at given path.

--html=path , create html report file at given path.

0