mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
rename "image_mode_names" to "modes"
This commit is contained in:
parent
5573ec7490
commit
5c960d6abc
|
@ -29,7 +29,7 @@ elif "GITHUB_ACTIONS" in os.environ:
|
|||
uploader = "github_actions"
|
||||
|
||||
|
||||
image_mode_names = (
|
||||
modes = (
|
||||
"1",
|
||||
"L",
|
||||
"LA",
|
||||
|
|
|
@ -28,15 +28,15 @@ from .helper import (
|
|||
assert_image_similar_tofile,
|
||||
assert_not_all_same,
|
||||
hopper,
|
||||
image_mode_names,
|
||||
is_win32,
|
||||
mark_if_feature_version,
|
||||
modes,
|
||||
skip_unless_feature,
|
||||
)
|
||||
|
||||
|
||||
class TestImage:
|
||||
@pytest.mark.parametrize("mode", image_mode_names)
|
||||
@pytest.mark.parametrize("mode", modes)
|
||||
def test_image_modes_success(self, mode: str) -> None:
|
||||
Image.new(mode, (1, 1))
|
||||
|
||||
|
@ -1017,7 +1017,7 @@ class TestImage:
|
|||
|
||||
|
||||
class TestImageBytes:
|
||||
@pytest.mark.parametrize("mode", image_mode_names)
|
||||
@pytest.mark.parametrize("mode", modes)
|
||||
def test_roundtrip_bytes_constructor(self, mode: str) -> None:
|
||||
im = hopper(mode)
|
||||
source_bytes = im.tobytes()
|
||||
|
@ -1025,7 +1025,7 @@ class TestImageBytes:
|
|||
reloaded = Image.frombytes(mode, im.size, source_bytes)
|
||||
assert reloaded.tobytes() == source_bytes
|
||||
|
||||
@pytest.mark.parametrize("mode", image_mode_names)
|
||||
@pytest.mark.parametrize("mode", modes)
|
||||
def test_roundtrip_bytes_method(self, mode: str) -> None:
|
||||
im = hopper(mode)
|
||||
source_bytes = im.tobytes()
|
||||
|
@ -1034,7 +1034,7 @@ class TestImageBytes:
|
|||
reloaded.frombytes(source_bytes)
|
||||
assert reloaded.tobytes() == source_bytes
|
||||
|
||||
@pytest.mark.parametrize("mode", image_mode_names)
|
||||
@pytest.mark.parametrize("mode", modes)
|
||||
def test_getdata_putdata(self, mode: str) -> None:
|
||||
im = hopper(mode)
|
||||
reloaded = Image.new(mode, im.size)
|
||||
|
|
|
@ -10,7 +10,7 @@ import pytest
|
|||
|
||||
from PIL import Image
|
||||
|
||||
from .helper import assert_image_equal, hopper, image_mode_names, is_win32
|
||||
from .helper import assert_image_equal, hopper, is_win32, modes
|
||||
|
||||
# CFFI imports pycparser which doesn't support PYTHONOPTIMIZE=2
|
||||
# https://github.com/eliben/pycparser/pull/198#issuecomment-317001670
|
||||
|
@ -205,7 +205,7 @@ class TestImageGetPixel(AccessTest):
|
|||
with pytest.raises(error):
|
||||
im.getpixel((-1, -1))
|
||||
|
||||
@pytest.mark.parametrize("mode", image_mode_names)
|
||||
@pytest.mark.parametrize("mode", modes)
|
||||
def test_basic(self, mode: str) -> None:
|
||||
self.check(mode)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user