mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
Merge pull request #7835 from Yay295/patch-1
Parametrize test_p_from_rgb_rgba()
This commit is contained in:
commit
0fc9b9183f
|
@ -685,15 +685,18 @@ class TestImage:
|
||||||
_make_new(im, blank_p, ImagePalette.ImagePalette())
|
_make_new(im, blank_p, ImagePalette.ImagePalette())
|
||||||
_make_new(im, blank_pa, ImagePalette.ImagePalette())
|
_make_new(im, blank_pa, ImagePalette.ImagePalette())
|
||||||
|
|
||||||
def test_p_from_rgb_rgba(self) -> None:
|
@pytest.mark.parametrize(
|
||||||
for mode, color in [
|
"mode, color",
|
||||||
|
(
|
||||||
("RGB", "#DDEEFF"),
|
("RGB", "#DDEEFF"),
|
||||||
("RGB", (221, 238, 255)),
|
("RGB", (221, 238, 255)),
|
||||||
("RGBA", (221, 238, 255, 255)),
|
("RGBA", (221, 238, 255, 255)),
|
||||||
]:
|
),
|
||||||
im = Image.new("P", (100, 100), color)
|
)
|
||||||
expected = Image.new(mode, (100, 100), color)
|
def test_p_from_rgb_rgba(self, mode: str, color: str | tuple[int, ...]) -> None:
|
||||||
assert_image_equal(im.convert(mode), expected)
|
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:
|
def test_no_resource_warning_on_save(self, tmp_path: Path) -> None:
|
||||||
# https://github.com/python-pillow/Pillow/issues/835
|
# https://github.com/python-pillow/Pillow/issues/835
|
||||||
|
|
Loading…
Reference in New Issue
Block a user