Skip to content

xfail reason isn't part of xml message field (in comparison to skip) #4907

@dafnita87

Description

@dafnita87

Hello team,

We are not able to see the xfail reason message in jenkins report.
After checking jreport.xml, we found the following:

pytest.xfail('lets see XFAIL')
<?xml version="1.0" encoding="utf-8"?>
<testsuite errors="0" failures="0" name="pytest" skipped="1" tests="1" time="18.862">
    <testcase classname="tests.casb.IM.test_im_conversations.TestIM" file="tests/casb/IM/test_im_conversations.py"
              line="7"
              name="test_im_channel_conversation[vendor:slack_slack_casb_license-dlp_content_file-pps_qa_clean_PCITrue#3.docx0-dialog]"
              time="18.552">
        <skipped message="expected test failure">reason: lets see XFAIL</skipped>

I compared it to skip and the skip reason is added accordingly to the message field. See the difference:

pytest.skip('lets see SKIP')
<?xml version="1.0" encoding="utf-8"?>
<testsuite errors="0" failures="0" name="pytest" skipped="1" tests="1" time="2.519">
    <testcase classname="tests.casb.IM.test_im_conversations.TestIM" file="tests/casb/IM/test_im_conversations.py"
              line="7"
              name="test_im_channel_conversation[vendor:slack_slack_casb_license-dlp_content_file-pps_qa_clean_PCITrue#3.docx0-dialog]"
              time="2.442">
       <skipped message="lets see SKIP" type="pytest.skip">

The versions i'm using:
pytest 4.3.0 (the latest)
pytest-html 1.20.0 (the latest as well).

Are you aware of this issue? Can I expect for a resolution?

Thanks!
Dafna

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugin: junitxmlrelated to the junitxml builtin plugintype: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions