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

Commits on Mar 26, 2024

  1. Fix the tests with exceptions assertions having multiple top-level st…

    …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
    cicichen01 authored and facebook-github-bot committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    87c8c9c View commit details
    Browse the repository at this point in the history