跳转到主要内容

pytest插件,用于显示失败测试的完整节点ID

项目描述

pytest-wholenodeid

pytest-wholenodeid将在标题中打印测试失败的完整节点ID。

它将这个

=============================================== FAILURES ===============================================
______________________________ TriggerRuleMatchTests.test_match_locale _________________________________
Traceback (most recent call last):
  File "/home/willkg/mozilla/fjord/fjord/suggest/providers/trigger/tests/test_models.py", line 24, in test_match_locale
    for tr_locales, feedback_locale, expected in tests:
NameError: global name 'tests' is not defined

转换为这个

=============================================== FAILURES ===============================================
____ fjord/suggest/providers/trigger/tests/test_models.py::TriggerRuleMatchTests::test_match_locale ____
Traceback (most recent call last):
  File "/home/willkg/mozilla/fjord/fjord/suggest/providers/trigger/tests/test_models.py", line 24, in test_match_locale
    for tr_locales, feedback_locale, expected in tests:
NameError: global name 'tests' is not defined

为什么?

因为这样您就可以将标题中的节点ID复制并粘贴,以更容易地运行该特定测试。

快速开始

安装

$ pip install pytest-wholenodeid

默认情况下,它就会生效。如果您不想使用wholenodeid,则可以通过传递--nowholenodeid作为参数来禁用它。

项目详情

代码::

https://github.com/willkg/pytest-wholenodeid

文档::

您正在阅读它

问题跟踪::

https://github.com/willkg/pytest-wholenodeid/issues

许可::

简化版BSD许可;请参阅LICENSE文件

项目详情


下载文件

下载适合您平台的项目文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分布

pytest-wholenodeid-0.2.tar.gz (2.7 kB 查看哈希值)

上传时间

构建版本

pytest_wholenodeid-0.2-py2.py3-none-any.whl (4.7 kB 查看哈希值)

上传时间 Python 2 Python 3

由以下支持