为什么 Jenkins 不显示来自 Pytest 生成的 JUnit xml 文件的跳过消息?

问题描述

这是xml文件输出内容的示例:

<testcase classname="test" name="test_sequence" time="0.000">
            <skipped type="pytest.skip" message="version 0.3">C:\Users\me\Jenkins\.jenkins\workspace\project\project1\tests\MyTests.py:959: version 0.3</skipped>

这是 Jenkins here显示的示例。如您所见,下拉箭头是灰色的。此跳过的测试没有附加任何消息。似乎完全忽略了消息属性

这是我的一个测试示例:

@pytest.mark.skip(reason="version 0.3")
    def test_sequence(self):
        assert False

这是我的 Jenkinsfile 中告诉 pytest 输出 xml 文件的行:

bat "pytest -v --cov=tests --junitxml=reports/unit_tests.xml"

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)