-
Notifications
You must be signed in to change notification settings - Fork 45
TST: Only skip/xfail tests whose ids exactly match #232
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
Conversation
Thanks for the PR but its intentional behaviour for skip/xfail'd tests to match multiple test cases, which is mostly useful for parametrized tests where adopters know they'll all fail. |
The problem, though is that it becomes impossible to skip some test cases without skipping other test cases that might not fail. (e.g. skipping |
I asked @lithomas1 to open this PR. Can we make it so this either matches the full test with the parameterization, or a full test name without the parameterization part? Verboseness is not an issue for a file, but specificity is. |
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.
The problem, though is that it becomes impossible to skip some test cases without skipping other test cases that might not fail.
Ah I see.
Can we make it so this either matches the full test with the parameterization, or a full test name without the parameterization part? Verboseness is not an issue for a file, but specificity is.
I'll mull over but if you folks have an idea please update the PR. I don't think it's a good idea accepting this PR as-is because 1) it makes specifying parameterised tests very verbose 2) breaks existing configs without any warnings/etc.. I imagine some regex for pytest's square bracket syntax for atomic "parameter" test cases is what we'd want to look at, which would avoid the need to break existing configs too.
Just to be sure, there are some warnings that are printed when an xfail doesn't match anything. |
Maybe we can turn the lines of the skip file into a regex? I think with a regex I can use |
I technically don't need this PR anymore (since I resolved the failures mentioned above), but this might still be a good idea regardless. (e.g. I'm pretty sure this also happens for torch in array-api-compat |
Making it a regex would be even more breaking than this. The However, I'm currently not convinced that this change is an issue. Are there xfails files out there that are making use of this prefix logic? |
Do we have reason to believe that it isn't enough to only accept
I don't see the value in accepting subsets other than those three cases, and trying to do so would risk lead to false positives like the The only thing I can think of is you might want to skip all parameterized tests for a given function like Another option would be to only match those three cases if the skip name starts with |
I don't have a sense of usage actually tbf, so maybe no one's currently skipping any of the parametrized tests. I am generally worried that for things like the special case tests, if you want to skip/xfail a whole test case, you'd have to manually specify 100+ cases.
I agree regex for things like this seems a bit too much esp. considering how square brackets, but it is a well-defined and well-known format in the end if we did want to skip parameterized tests (or even specifically a subset of parameters) 🤔 |
Maybe we could also extend it to allow skipping |
We ran into the exact case of
I'd also accept a directory/partial path, in case we split into directories later, but otherwise the list seems complete to me. |
I've opened #273 with my suggestions. |
This was superceeded by #273 |
No description provided.