Skip to content

junit output doesn't add skipped tests into tests total #1549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fushi opened this issue May 4, 2016 · 2 comments
Closed

junit output doesn't add skipped tests into tests total #1549

fushi opened this issue May 4, 2016 · 2 comments

Comments

@fushi
Copy link

fushi commented May 4, 2016

If you have a test that is skipped, the test case still is inserted into the xml, and the skips attribute is incremented, but the tests attribute is not. This causes a mismatch between the number of test cases, and the number in the tests attribute:

def test_fail():

> assert False
E assert False

test_uninstall.py:13: AssertionError/Users/jtowler/source/clover/web_testing/conftest.py:164: <py._xmlgen.raw object at 0x10ac03d50>

@nicoddemus
Copy link
Member

import pytest

def test1():
    pass

def test2():
    pytest.skip('reasons')

XML:

<?xml version="1.0" encoding="utf-8"?>
<testsuite errors="0" failures="0" name="pytest" skips="1" tests="1" time="0.038">
    <testcase classname="foo" file="foo.py" line="2" name="test1" time="0.0009999275207519531"/>
    <testcase classname="foo" file="foo.py" line="6" name="test2" time="0.0">
        <skipped message="reasons" type="pytest.skip">X:\pytest\foo.py:8: &lt;py._xmlgen.raw object at 0x032D6E90&gt;</skipped>
    </testcase>
</testsuite>

So the tests attribute of the testsuite node should be total number of tests, instead of tests actually executed?

@fushi
Copy link
Author

fushi commented May 5, 2016

That's correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants