【问题标题】:What is the current way to export HTML reports from pytest?从 pytest 导出 HTML 报告的当前方法是什么?
【发布时间】:2014-08-21 21:01:12
【问题描述】:

以下帖子 Py.Test : Reporting and HTML output 概述了一种使用 html 报告提交 py-test 的方法,但它不适用于 pytest 2.6.1

“--cov”和“--cov-report”选项对我来说都失败了。

有没有办法从 pytest 2.6.1 生成 HTML 报告?

【问题讨论】:

    标签: pytest


    【解决方案1】:

    展示或描述它是如何失败的会很有用。但是请注意,覆盖范围和这些选项由需要单独安装的pytest-cov 插件提供:https://pypi.python.org/pypi/pytest-cov

    如果这不是问题,请更新问题并提供更多详细信息。

    【讨论】:

      【解决方案2】:

      pytest-html 是 py.test 的插件,它为测试结果生成 HTML 报告。更多信息@https://github.com/pytest-dev/pytest-html

      【讨论】:

        【解决方案3】:

        这个问题没问题,但它让谷歌搜索结果到这里:

        从 2.7 开始,下面应该可以正常使用 Python

        pytest --cov-report=html ...
        

        请参阅:https://pytest-cov.readthedocs.io/en/latest/reporting.html

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2018-07-24
          • 2018-04-05
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多