-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
Clean up test_parser.py, use xFail instead of skip where appropriate #1428
Conversation
Why change the skip to xfail? xfail implies the test should be fixed in the future, i.e. failing for now but should work. (I'm sure you know pytest supports skip too) Also, I'm wondering if this PR won't cause too many collisions with the lark.lark PR.. |
I somewhat disagree: While this is a possible meaning, I would in this case interpret it as these should fail, and if they don't the tests aren't actually testing for what they should, without any promises about the future. E.g. a test case that is designed to specifically need the
I don't think so? That PR hasn't touched |
Oh right, sorry my bad. As for xfail, I don't think it means that the test won't function, but rather that the test is correct but the source code isn't. So for example xfailing ambiguity on lalr would mean that we expect lalr to support ambiguity, and it's temporarily broken. If it's not a bother, could you please change xfail into skip? |
This is a possible interpretation, and probably the more common one. But I don't think the feature itself is all too prescriptive in this regard. As a concrete example, consider the tests that use the tree less |
Yes, using Earley in that case should produce an error, but usually that would be caught in an AssertRaises and not with the xfail mechanism.
Edit: I take it back. I just ran it in the console and got a huge wall of xfail warnings.. Let's just use skip, okay? |
Sure, did that. Now it's a huge wall of skip warnings instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
For whatever reason, the wall of skips is 3 times smaller than the wall of xfails was.
I also think to make it even less, by replacing a few of the skips with a simple if stmt. But I can do that later, after this has been merged.
This is something I did while working on the
Lark.scan
implementation. I wanted to usexfail
and decided that it should be quite useful for many other tests as well. I also deleted a few old comments/completely skipped tests suggesting features that will probably never be implemented.I adjusted a few of the conditions based on the actual behavior of the code, for example
cyk
does actually support the tree lesstransformer
argument. It doesn't have quite as big of a benefit, but it does work.