Skip to content
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
Assignees
Milestone

Comments

@gprasad84
Copy link

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
Copy link
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
Copy link
Member

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

@The-Compiler
Copy link
Member

The-Compiler commented Aug 5, 2016

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

@hackebrot
Copy link
Member

That would be on master branch, right?

@The-Compiler
Copy link
Member

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

@hackebrot
Copy link
Member

@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
Copy link
Member

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants