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 broken string in test error message #4622

Merged
merged 1 commit into from May 13, 2020

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented May 13, 2020

Hasn't cropped up because the test is passing :)

Demo

average_diff = 2
max_average_diff = 1
band = "R"

# broken
msg = "average pixel value difference {:.4f} > expected {:.4f} "
"for '{}' band".format(average_diff, max_average_diff, band)

print(msg)

# fixed
msg = (
    "average pixel value difference {:.4f} > expected {:.4f} "
    "for '{}' band".format(average_diff, max_average_diff, band)
)

print(msg)
average pixel value difference {:.4f} > expected {:.4f}
average pixel value difference 2.0000 > expected 1.0000 for 'R' band

@hugovk hugovk added Bug Any unexpected behavior, until confirmed feature. Testing labels May 13, 2020
@radarhere
Copy link
Member

Nice catch

@radarhere radarhere merged commit 96f2ef1 into python-pillow:master May 13, 2020
@hugovk hugovk deleted the fix-string branch May 13, 2020 12:06
@hugovk
Copy link
Member Author

hugovk commented May 13, 2020

Found by the new Flake8 3.8.

There's a few other minor things too, but I've not updated those (or pre-commit) yet as Black doesn't like it, so they can wait a bit.

psf/black#195 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Any unexpected behavior, until confirmed feature. Testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants