-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-5514 Specific assertions for "is" and "is not None" #2502
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
Conversation
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! The only minor issue (nit, even) I notice is that "better" is subjective and what's actually changing is the assertions, from general (True/False) to specific (Is/IsNot) and that is objectively better 😂
LGTM! The only minor issue (nit, even) I notice is that "better" is subjective and what's actually changing is the assertions, from general (True/False) to specific (Is/IsNot) and that is objectively better 😂
Good point! thanks for the name change!
(grouped them together because there wasn't a lot of each, but i can seperate the two into two different PRs if that's preferred)
self.assertTrue(x is y)
->self.assertIs(x, y)
self.assertTrue(x is not None)
->self.assertIsNotNone(x)