-
Notifications
You must be signed in to change notification settings - Fork 119
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
fix warning B908 #816
fix warning B908 #816
Conversation
This pull request was exported from Phabricator. Differential Revision: D53461157 |
Summary: Fix the warning on the code: B908: Contexts with exceptions assertions like with self.assertRaises or with pytest.raises should not have multiple top-level statements. Each statement should be in its own context. That way, the test ensures that the exception is raised only in the exact statement where you expect it. This warning is raised by flake8-bugbear: https://github.com/PyCQA/flake8-bugbear This diff fixed it by mimicking D50647471. Reviewed By: ishachirimar Differential Revision: D53461157
9ee11f3
to
e46ae4f
Compare
This pull request was exported from Phabricator. Differential Revision: D53461157 |
test comment. |
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.
test comment.
Summary: Fix the warning on the code: B908: Contexts with exceptions assertions like with self.assertRaises or with pytest.raises should not have multiple top-level statements. Each statement should be in its own context. That way, the test ensures that the exception is raised only in the exact statement where you expect it. This warning is raised by flake8-bugbear: https://github.com/PyCQA/flake8-bugbear This diff fixed it by mimicking D50647471. Reviewed By: ishachirimar Differential Revision: D53461157
e46ae4f
to
126b726
Compare
This pull request was exported from Phabricator. Differential Revision: D53461157 |
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.
lgtm
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 changes look good. The failures are not associated with this change and are tests / changes that need to fixed.
Summary:
Fix the warning on the code:
B908: Contexts with exceptions assertions like with self.assertRaises or with pytest.raises should not have multiple top-level statements. Each statement should be in its own context. That way, the test ensures that the exception is raised only in the exact statement where you expect it.
This warning is raised by flake8-bugbear: https://github.com/PyCQA/flake8-bugbear
This diff fixed it by mimicking D50647471.
Differential Revision: D53461157