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

Parametrize test_p_from_rgb_rgba() #7835

Merged
merged 3 commits into from
Feb 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
parametrize test_p_from_rgb_rgba()
  • Loading branch information
Yay295 committed Feb 26, 2024
commit ece34104cb0671ef0f1f59e9924fb1be0bcf351a
15 changes: 9 additions & 6 deletions Tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,15 +685,18 @@ def _make_new(
_make_new(im, blank_p, ImagePalette.ImagePalette())
_make_new(im, blank_pa, ImagePalette.ImagePalette())

def test_p_from_rgb_rgba(self) -> None:
for mode, color in [
@pytest.mark.parametrize(
("mode", "color"),
Yay295 marked this conversation as resolved.
Show resolved Hide resolved
(
("RGB", "#DDEEFF"),
("RGB", (221, 238, 255)),
("RGBA", (221, 238, 255, 255)),
]:
im = Image.new("P", (100, 100), color)
expected = Image.new(mode, (100, 100), color)
assert_image_equal(im.convert(mode), expected)
),
)
def test_p_from_rgb_rgba(self, mode, color) -> None:
Yay295 marked this conversation as resolved.
Show resolved Hide resolved
im = Image.new("P", (100, 100), color)
expected = Image.new(mode, (100, 100), color)
assert_image_equal(im.convert(mode), expected)

def test_no_resource_warning_on_save(self, tmp_path: Path) -> None:
# https://github.com/python-pillow/Pillow/issues/835
Expand Down
Loading