Skip to content

Passing expectedFailure (aka TODO test) should be treated as a failure #47

@mcepl

Description

@mcepl

My problem is with this text (in the “TODO tests” part of the current specification):

Should a todo test point begin succeeding, the harness may report it in some way that indicates that whatever was supposed to be done has been, and it should be promoted to a normal Test Point.

That’s actually a difference from what for example Python’s unittest.expectedFailure says:

Mark the test as an expected failure or error. If the test fails or errors in the test function itself (rather than in one of the test fixture methods) then it will be considered a success. If the test passes, it will be considered a failure.

Pytest at least treats passed xfails separately:

An xfail means that you expect a test to fail for some reason. A common example is a test for a feature not yet implemented, or a bug not yet fixed. When a test passes despite being expected to fail (marked with pytest.mark.xfail), it’s an xpass and will be reported in the test summary.

For me, treatment of passed expectedFailures was the reason why to abandon use of the TAP protocol for M2Crypto, and it seems to me that the messy state of the specification bothers others as well (that reporter is probably lobbying more for the pytest-style treatment of counting them separately, I would be happy if the passed TODO tests were just considered a failure).

Cc: @mblayman @lorcap

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions