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

xpass logic #1327

Closed
HPotter opened this issue Jan 13, 2016 · 4 comments
Closed

xpass logic #1327

HPotter opened this issue Jan 13, 2016 · 4 comments

Comments

@HPotter
Copy link

HPotter commented Jan 13, 2016

I'm trying to understand what exactly "xpass" and "xfail" are.

I understood that when my xfail test fails, that's expected and OK. But when my xfail test passes - is it success or failure? I suggest that it's also success, because py.test command exits with 0 exit code even if there were any xpassed tests.

Why I'm asking: I'm running my tests on Teamcity CI with teamcity-messages module to report pytest results to Teamcity. And teamcity-messages interprets xpassed tests as failures.

PS How can I determine from TestReport object (in pytest_runtest_logreport) if test xfailed\xpassed (or at least marked as xfail)?

@RonnyPfannschmidt
Copy link
Member

see #1299

in hindsight being lax on xpass was a mistake

i don't recall offhand how its decided - i invite you to take a look at how it works, the code in question should reasonably discoverable

@HPotter
Copy link
Author

HPotter commented Jan 13, 2016

OK, I've got it.
It seems that I've incorrectly understood meaning of xfail decorator because of my not-so-good English and wrong testrunner behavior.

Thanks for your answer, it was pretty useful for me

@nicoddemus
Copy link
Member

Could you close this if you don't have any further questions @HPotter?

@HPotter
Copy link
Author

HPotter commented Jan 14, 2016

Sure.

@HPotter HPotter closed this as completed Jan 14, 2016
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

3 participants