mirror of
https://github.com/python-pillow/Pillow.git
synced 2026-02-04 06:25:52 +03:00
Merge c18d0d012e into 62aa42f9da
This commit is contained in:
commit
d12475751c
|
|
@ -572,7 +572,7 @@ class TestImage:
|
|||
im = Image.new("L", (100, 0))
|
||||
assert im.size == (100, 0)
|
||||
|
||||
assert Image.new("RGB", (1, 1))
|
||||
assert isinstance(Image.new("RGB", (1, 1)), Image.Image)
|
||||
# Should pass lists too
|
||||
i = Image.new("RGB", [1, 1])
|
||||
assert isinstance(i.size, tuple)
|
||||
|
|
|
|||
|
|
@ -112,8 +112,6 @@ def test_to_array(mode: str, dtype: pyarrow.DataType, mask: list[int] | None) ->
|
|||
|
||||
reloaded = Image.fromarrow(arr, mode, img.size)
|
||||
|
||||
assert reloaded
|
||||
|
||||
assert_image_equal(img, reloaded)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -56,9 +56,8 @@ def roundtrip(expected: Image.Image) -> None:
|
|||
def test_sanity(tmp_path: Path) -> None:
|
||||
# Segfault test
|
||||
app: QApplication | None = QApplication([])
|
||||
ex = Example()
|
||||
ex = Example() # noqa: F841
|
||||
assert app # Silence warning
|
||||
assert ex # Silence warning
|
||||
|
||||
for mode in ("1", "RGB", "RGBA", "L", "P"):
|
||||
# to QPixmap
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@ def test_dos_text() -> None:
|
|||
try:
|
||||
im = Image.open(TEST_FILE)
|
||||
im.load()
|
||||
except ValueError as msg:
|
||||
assert msg, "Decompressed Data Too Large"
|
||||
except ValueError:
|
||||
return
|
||||
|
||||
assert isinstance(im, PngImagePlugin.PngImageFile)
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ python_version = "3.10"
|
|||
pretty = true
|
||||
disallow_any_generics = true
|
||||
disallow_untyped_defs = true
|
||||
enable_error_code = "ignore-without-code"
|
||||
enable_error_code = [ "ignore-without-code", "truthy-bool" ]
|
||||
extra_checks = true
|
||||
follow_imports = "silent"
|
||||
warn_redundant_casts = true
|
||||
|
|
|
|||
|
|
@ -438,33 +438,28 @@ def preinit() -> None:
|
|||
return
|
||||
|
||||
try:
|
||||
from . import BmpImagePlugin
|
||||
from . import BmpImagePlugin as BmpImagePlugin
|
||||
|
||||
assert BmpImagePlugin
|
||||
except ImportError:
|
||||
pass
|
||||
try:
|
||||
from . import GifImagePlugin
|
||||
from . import GifImagePlugin as GifImagePlugin
|
||||
|
||||
assert GifImagePlugin
|
||||
except ImportError:
|
||||
pass
|
||||
try:
|
||||
from . import JpegImagePlugin
|
||||
from . import JpegImagePlugin as JpegImagePlugin
|
||||
|
||||
assert JpegImagePlugin
|
||||
except ImportError:
|
||||
pass
|
||||
try:
|
||||
from . import PpmImagePlugin
|
||||
from . import PpmImagePlugin as PpmImagePlugin
|
||||
|
||||
assert PpmImagePlugin
|
||||
except ImportError:
|
||||
pass
|
||||
try:
|
||||
from . import PngImagePlugin
|
||||
from . import PngImagePlugin as PngImagePlugin
|
||||
|
||||
assert PngImagePlugin
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ class ImageFont:
|
|||
except Exception:
|
||||
pass
|
||||
else:
|
||||
if image and image.mode in ("1", "L"):
|
||||
if image.mode in ("1", "L"):
|
||||
break
|
||||
else:
|
||||
if image:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user