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

Clean up tests #6653

Closed
wants to merge 5 commits into from
Closed

Clean up tests #6653

wants to merge 5 commits into from

Conversation

Yay295
Copy link
Contributor

@Yay295 Yay295 commented Oct 9, 2022

No description provided.

@Yay295 Yay295 mentioned this pull request Oct 9, 2022
@hugovk
Copy link
Member

hugovk commented Dec 30, 2022

Thanks for this PR!

The first five commits look good.

"use tuple or set instead of list in tests" is too big to review properly, and I know tuples are generally preferred to lists, but in this case I don't think the huge review effort is worth any noticeable benefit. (I think these kind of changes are okay when making other changes to a file.)

And @radarhere had a question about "sort colors before comparing them", so I'll defer on that.

Also I wouldn't worry about the last few commits splitting long lines and wrangling with the formatting, it's okay to have longish strings (below the limit) as they're easier to grep.

Tests/helper.py Outdated Show resolved Hide resolved
@@ -57,13 +57,13 @@ def test_convolution_modes(self):
Image.Resampling.LANCZOS,
),
)
def test_reduce_filters(self, resample):
r = self.resize(hopper("RGB"), (15, 12), resample)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is 'resampling_filter' clearer? 'resample' is the name of the variable when the core resize operation is called in Image.py

return self._new(self.im.resize(size, resample, box))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because "resample" is an action, while "resampling filter" is an object. The thing being passed is (an ID for) a resampling filter, not a "resample". It doesn't work to say that "resample" is the type of the thing being passed either, because the type of the thing being passed is a Resampling enum item.

@Yay295
Copy link
Contributor Author

Yay295 commented May 4, 2023

#6900, #6904, and #6949 were split off from this, so I'd like those to be merged before I rebase this.

@radarhere
Copy link
Member

Those PRs have all now been merged.

@Yay295
Copy link
Contributor Author

Yay295 commented May 7, 2023

I've rebased it. Should I create a new pull request for this, or keep using this one?

@hugovk
Copy link
Member

hugovk commented May 7, 2023

This PR is fine.

I don't think we really need 3f045ea "use tuple or set instead of list in tests", there's a lot of changes (+406 −399 in 54 files) for little benefit.

@Yay295
Copy link
Contributor Author

Yay295 commented May 7, 2023

I've moved the helper.py changes to #7140.

@Yay295 Yay295 deleted the test_cleanup branch June 8, 2023 05:42
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.

None yet

3 participants