Skip to content
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 the tests with exceptions assertions having multiple top-level statements #1264

Closed
wants to merge 1 commit into from

Conversation

cicichen01
Copy link
Contributor

Summary:
As titled. Add error message checks as well for test comprehensity and code readability.

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.

Differential Revision: D55344319

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D55344319

…atements (pytorch#1264)

Summary:

As titled. Add error message checks as well for test comprehensity and code readability.

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.

Differential Revision: D55344319
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D55344319

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in dab9447.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants