Pytest加载项,用于显示失败的整个节点ID
pytest-wholenodeid的Python项目详细描述
pytest wholenodeid
pytest wholenodeid将在 头球。
它会变成这样:
=============================================== 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
它默认工作。如果你不想要全名,你可以通过 --nowholenodeid作为参数禁用它。
项目详细信息
Code: | https://github.com/willkg/pytest-wholenodeid |
---|---|
Documentation: | You’re reading it |
Issue tracker: | https://github.com/willkg/pytest-wholenodeid/issues |
License: | Simplified BSD License; see LICENSE file |