-
Notifications
You must be signed in to change notification settings - Fork 6
Writes "ok" instead of "not ok" for an expected failure #55
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
Comments
No, you've got a good eye and are not missing anything. I had to make a judgement call between two competing behaviors. In the
https://docs.python.org/3/library/unittest.html#unittest.expectedFailure Continuing the TAP spec, it says:
Since Python wants expected failures to count as success (when the assertion fails) and the TAP spec says that unexpected passes are a bonus, I chose to represent expected failures in line with the Python definition. I hope that clears things up. |
Hmmm... maybe there's something else going on. I dug into the code a bit deeper and it appears that the code that I should be running actually matched what you stated. https://github.com/python-tap/tappy/blob/master/tap/runner.py#L59 But I guess that's not the code that's running. It's probably in this area of the plugin: https://github.com/python-tap/pytest-tap/blob/master/src/pytest_tap/plugin.py#L98 I've not looked at this code in a long time so I don't know if anything has changed about the |
I've looked a bit into this, but various things don't make sense to me (like the The test I looked at: import unittest
import pytest
class Test(unittest.TestCase):
@unittest.expectedFailure
def test_unittest_xfail_fail(self):
assert 0
@pytest.mark.xfail(strict=False, reason="foo")
def test_xfail_nonstrict_fail(self):
assert 0
@pytest.mark.xfail(strict=True, reason="foo")
def test_xfail_strict_fail(self):
assert 0
@unittest.expectedFailure
def test_unittest_xfail_nofail(self):
pass
@pytest.mark.xfail(strict=False, reason="foo")
def test_xfail_nonstrict_nofail(self):
pass
@pytest.mark.xfail(strict=True, reason="foo")
def test_xfail_strict_nofail(self):
pass |
I would have expected it to write out "not ok", since the the TAP spec says for TODO: "They are not expected to succeed".
The problem is that I have a TAP consumer which complains that this test succeeded unexpectedly.
Am I missing something?
The text was updated successfully, but these errors were encountered: