-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Make SkipInfo with expected_failure an XFAIL #63481
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
Make SkipInfo with expected_failure an XFAIL #63481
Conversation
[ghstack-poisoned]
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit 8d7a34c (more details on the Dr. CI page):
ci.pytorch.org: 1 failedThis comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions to the (internal) Dr. CI Users group. |
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.
Nice, thank you!
|
@heitorschueroff has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
| expected_failure: whether to assert that skipped tests fail | ||
| """ | ||
| decorator = expectedFailure(device_type) if expected_failure else skipIf(True, "Skipped!") | ||
| decorator = unittest.expectedFailure if expected_failure else unittest.skip("Skipped!") |
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.
Why not wrap the function in the expectedFailure decorator?
| fn(slf, *args, **kwargs) |
Like could the unittest.expectedFailure decorator be applied to that function before calling it?
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.
That won't work. The unittest.expectedFailure is implemented as follows
def expectedFailure(test_item):
test_item.__unittest_expecting_failure__ = True
return test_itemSo wrapping fn with it will not change the behavior of the function. We need to expose this attribute to the unittest engine.
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.
Aha! You're right. My mistake.
Codecov Report
@@ Coverage Diff @@
## gh/heitorschueroff/15/base #63481 +/- ##
==============================================================
- Coverage 74.45% 74.42% -0.04%
==============================================================
Files 2118 2118
Lines 212264 212265 +1
==============================================================
- Hits 158041 157968 -73
- Misses 54223 54297 +74 |
|
@heitorschueroff merged this pull request in 50a3b6a. |
Stack from ghstack:
This PR changes the SkipInfo decorators to use unittest.expectedFailure so that the test reports as XFAIL as opposed to PASSED.
Note that changing the expectedFailure here
pytorch/torch/testing/_internal/common_device_type.py
Line 879 in 30e1c74
fixes #63363
Differential Revision: D30397154