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

When an xfail marked test passes(xpass), the report.outcome value shows as 'failed' #1546

Closed
gprasad84 opened this Issue May 2, 2016 · 7 comments

Comments

Projects
None yet
5 participants
@gprasad84

gprasad84 commented May 2, 2016

When an xfail marked test passes(xpass), the report.outcome value is 'failed'. Since the xfail test passed shouldnt the outcome of the test be 'passed' ?

Running pytest (2.9.1), py (1.4.31) on Mac OSX

# conftest.py
def pytest_runtest_logreport(report):
    print "When: {} Outcome: {}".format(report.when, report.outcome)

# test_sub.py
@pytest.mark.xfail
def test_xpass():
    pass

Snippet of the console output

When: setup Outcome: passed
XPASSWhen: call Outcome: failed
When: teardown Outcome: passed
@RonnyPfannschmidt

This comment has been minimized.

Member

RonnyPfannschmidt commented Jun 25, 2016

@hpk42

this one is an artifact of xpass being a failure before, xpass got changed to be more forgiving by default
we should probably fix that in pytest 3.0?

@nicoddemus nicoddemus added this to the 3.0 milestone Jun 26, 2016

@nicoddemus

This comment has been minimized.

Member

nicoddemus commented Jun 26, 2016

I think so... could you take a look @RonnyPfannschmidt?

@The-Compiler

This comment has been minimized.

Member

The-Compiler commented Aug 5, 2016

Should we do this for 3.0 as it's backwards-incompatible but probably relatively straightforward?

@hackebrot

This comment has been minimized.

Member

hackebrot commented Aug 5, 2016

That would be on master branch, right?

@The-Compiler

This comment has been minimized.

Member

The-Compiler commented Aug 5, 2016

@hackebrot I don't understand the question - are you asking if @gprasad84 is seeing this output on master?

@hackebrot

This comment has been minimized.

Member

hackebrot commented Aug 5, 2016

@The-Compiler Sorry about that. Looking into the issue right now and I was wondering if that change would go to master or features.

@The-Compiler

This comment has been minimized.

Member

The-Compiler commented Aug 6, 2016

While it is strictly speaking a bugfix, it might actually cause some trouble as it's backwards-incompatible. So I'd say to features. (Then again, in the end it probably doesn't matter as the next release should be v3.0 anyways)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment