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

Parametrized tests #6526

Merged
merged 5 commits into from Aug 24, 2022
Merged

Parametrized tests #6526

merged 5 commits into from Aug 24, 2022

Conversation

radarhere
Copy link
Member

Helps #6525

@Yay295
Copy link
Contributor

Yay295 commented Aug 23, 2022

test_image_resize.py can be parametrized more than that (I had to change the file extension to upload it here). test_image_resize.txt

Here too:

@pytest.mark.parametrize("mode", ("RGB", "L", "RGBA", "LA", "I", ""))
def test_formats(self, mode):
for resample in [Image.Resampling.NEAREST, Image.Resampling.BILINEAR]:

can be:

    @pytest.mark.parametrize("resample", (Image.Resampling.NEAREST, Image.Resampling.BILINEAR))
    @pytest.mark.parametrize("mode", ("RGB", "L", "RGBA", "LA", "I", ""))
    def test_formats(self, resample, mode):

It looks like you only parametrized one parameter, but the @pytest.mark.parametrize annotation can do more than that.

Tests/test_file_apng.py Outdated Show resolved Hide resolved
Tests/test_file_apng.py Outdated Show resolved Hide resolved
Tests/test_file_apng.py Outdated Show resolved Hide resolved
Tests/test_qt_image_toqimage.py Outdated Show resolved Hide resolved
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

Please can you merge/rebase to include #6529 and make sure the Windows tests pass?

@hugovk hugovk added the automerge Automatically merge PRs that are ready label Aug 24, 2022
@mergify mergify bot merged commit cb6c941 into python-pillow:main Aug 24, 2022
@radarhere radarhere deleted the parametrize branch August 24, 2022 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge PRs that are ready Testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants