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

@xfail annotation #4481

Closed
MikkelPaulson opened this issue Oct 8, 2020 · 6 comments
Closed

@xfail annotation #4481

MikkelPaulson opened this issue Oct 8, 2020 · 6 comments
Labels
feature/metadata Issues related to attributes and annotations type/enhancement A new idea that should be implemented

Comments

@MikkelPaulson
Copy link

MikkelPaulson commented Oct 8, 2020

A useful feature of pytest is its @pytest.mark.xfail annotation, which indicates that a test should run but is expected to fail. If a test so annotated does pass, the test run interprets it as a failure.

Generally this is used in TDD and BDD to indicate that a bug or feature is still a work in progress. It's distinct from skipping in that the failure when the test starts passing should prompt the developer to remove the annotation or update the test accordingly.

I did some looking around and was surprised to see that this seems to be a unique feature of pytest (at least by that name). I'd like to add it to PHPUnit, but wanted to get a 👍 👎 before starting work.

@MikkelPaulson MikkelPaulson added the type/enhancement A new idea that should be implemented label Oct 8, 2020
@sebastianbergmann
Copy link
Owner

I am open to the idea but I do think we should deprecate (and later remove) markTestIncomplete().

@MikkelPaulson
Copy link
Author

MikkelPaulson commented Oct 9, 2020 via email

@morozov
Copy link
Contributor

morozov commented Oct 12, 2020

FWIW, besides being often abused, markTestIncomplete() is useful in the cases where the same test is run against multiple implementations and some of them are known to fail. This way, an incomplete test documents a known issue.

@remorhaz
Copy link

This feature can be useful for testing of different PHPUnit constraints and extensions. It would be very convenient just to annotate that a concrete test "should fail".

@sebastianbergmann sebastianbergmann added the feature/metadata Issues related to attributes and annotations label Jun 3, 2021
@sebastianbergmann
Copy link
Owner

Won't implement.

@weitzman
Copy link

Any chance yu are open to this in some way other than an @xfail annotation? markTestIncomplete() isnt a great substitute IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/metadata Issues related to attributes and annotations type/enhancement A new idea that should be implemented
Projects
None yet
Development

No branches or pull requests

5 participants