mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-14 13:46:57 +03:00
Load before trying to catch exceptions
This commit is contained in:
parent
af521a1ce1
commit
aa22b24169
|
@ -324,17 +324,17 @@ def test_set_lut() -> None:
|
|||
|
||||
def test_wrong_mode() -> None:
|
||||
lut = ImageMorph.LutBuilder(op_name="corner").build_lut()
|
||||
imrgb = Image.new("RGB", (10, 10))
|
||||
iml = Image.new("L", (10, 10))
|
||||
imrgb_ptr = Image.new("RGB", (10, 10)).getim()
|
||||
iml_ptr = Image.new("L", (10, 10)).getim()
|
||||
|
||||
with pytest.raises(RuntimeError):
|
||||
_imagingmorph.apply(bytes(lut), imrgb.getim(), iml.getim())
|
||||
_imagingmorph.apply(bytes(lut), imrgb_ptr, iml_ptr)
|
||||
|
||||
with pytest.raises(RuntimeError):
|
||||
_imagingmorph.apply(bytes(lut), iml.getim(), imrgb.getim())
|
||||
_imagingmorph.apply(bytes(lut), iml_ptr, imrgb_ptr)
|
||||
|
||||
with pytest.raises(RuntimeError):
|
||||
_imagingmorph.match(bytes(lut), imrgb.getim())
|
||||
_imagingmorph.match(bytes(lut), imrgb_ptr)
|
||||
|
||||
# Should not raise
|
||||
_imagingmorph.match(bytes(lut), iml.getim())
|
||||
_imagingmorph.match(bytes(lut), iml_ptr)
|
||||
|
|
Loading…
Reference in New Issue
Block a user