-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
diagnosticsRelated to reporting of diagnostics.Related to reporting of diagnostics.help wantedContributions especially welcomeContributions especially welcome
Description
Summary
I do some image analysis and I have some pytests that use assert().
Here's an example:
def test_blurry(not_blurry_image):
assert is_blurry(not_blurry_image) == False
where is_blurry is my function that tests for blurryness and it returns a boolean.
My test is here to make sure that if I pass an image that I know is not blurry to my function it returns False.
And I have a warning from ruff about E712, which is:
Avoid equality comparisons to False; use if not is_blurry(no_blurry_image): for False checks
Not sure if it's my test that should be re-written or if ruff should not trigger this warning in an assert, but the explanation message here is incorrect as I can't use an if statement there.
Version
ruff 0.9.5
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
diagnosticsRelated to reporting of diagnostics.Related to reporting of diagnostics.help wantedContributions especially welcomeContributions especially welcome