-
Notifications
You must be signed in to change notification settings - Fork 25.7k
remove pytest.UsageError #58916
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
remove pytest.UsageError #58916
Conversation
Using `pytest.UsageError` in case `pytest` is available adds almost nothing as observed in #53820 (comment), but makes it harder to maintain: due to the conditional import, `mypy` is not able to handle `UsageError` in a type annotation. [ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit 6aeb57b (more details on the Dr. CI page and at hud.pytorch.org/pr/58916): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This 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.
Cool simplification
Using `pytest.UsageError` in case `pytest` is available adds almost nothing as observed in #53820 (comment), but makes it harder to maintain: due to the conditional import, `mypy` is not able to handle `UsageError` in a type annotation. [ghstack-poisoned]
Using `pytest.UsageError` in case `pytest` is available adds almost nothing as observed in #53820 (comment), but makes it harder to maintain: due to the conditional import, `mypy` is not able to handle `UsageError` in a type annotation. [ghstack-poisoned]
Using `pytest.UsageError` in case `pytest` is available adds almost nothing as observed in #53820 (comment), but makes it harder to maintain: due to the conditional import, `mypy` is not able to handle `UsageError` in a type annotation. [ghstack-poisoned]
|
@mruberry has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
|
Oops, this broke torchvision's tests :) We were relying on pytest.UsageError: https://github.com/pytorch/vision/pull/4121/files I understand and agree with the removal of The docs clearly mention that a Altough, TBF, I would personally prefer if this was just a and will avoid users (us) to import a custom exception from torch.testing (which also can add extra confusion as it's very similar to |
See #58916 (comment). [ghstack-poisoned]
See #58916 (comment). [ghstack-poisoned]
See #58916 (comment). [ghstack-poisoned]
See #58916 (comment). [ghstack-poisoned]
See #58916 (comment). [ghstack-poisoned]
See #58916 (comment). [ghstack-poisoned]
See #58916 (comment). Differential Revision: [D29626810](https://our.internmc.facebook.com/intern/diff/D29626810) [ghstack-poisoned]
See #58916 (comment). Differential Revision: [D29626810](https://our.internmc.facebook.com/intern/diff/D29626810) [ghstack-poisoned]
Summary: Pull Request resolved: #61031 See #58916 (comment). Test Plan: Imported from OSS Reviewed By: iramazanli Differential Revision: D29626810 Pulled By: mruberry fbshipit-source-id: 25ddf26815f9ef82b8234d7dac811a6a13a53c54
Stack from ghstack:
msgintorch.testing.assert_close#60254 tests for diagnostics in callablemsgintorch.testing.assert_closetorch.testing.assert_close#60163 update docstring examples oftorch.testing.assert_closetorch.testing.assert_closein case of mismatching values #60091 Improve error messages oftorch.testing.assert_closein case of mismatching valuestorch.testing.assert_close#58918 make assert_equal an example how to partialtorch.testing.assert_closeUsing
pytest.UsageErrorin casepytestis available adds almostnothing as observed in
#53820 (comment), but
makes it harder to maintain: due to the conditional import,
mypyisnot able to handle
UsageErrorin a type annotation.Differential Revision: D29259409