mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-04 13:40:54 +03:00
Do not catch exception only to assert it is None
This commit is contained in:
parent
aa686894a6
commit
f938af5c3c
|
@ -307,13 +307,8 @@ def test_apng_syntax_errors() -> None:
|
||||||
im.load()
|
im.load()
|
||||||
|
|
||||||
# we can handle this case gracefully
|
# we can handle this case gracefully
|
||||||
exception = None
|
|
||||||
with Image.open("Tests/images/apng/syntax_num_frames_low.png") as im:
|
with Image.open("Tests/images/apng/syntax_num_frames_low.png") as im:
|
||||||
try:
|
im.seek(im.n_frames - 1)
|
||||||
im.seek(im.n_frames - 1)
|
|
||||||
except Exception as e:
|
|
||||||
exception = e
|
|
||||||
assert exception is None
|
|
||||||
|
|
||||||
with pytest.raises(OSError):
|
with pytest.raises(OSError):
|
||||||
with Image.open("Tests/images/apng/syntax_num_frames_high.png") as im:
|
with Image.open("Tests/images/apng/syntax_num_frames_high.png") as im:
|
||||||
|
@ -405,13 +400,8 @@ def test_apng_save_split_fdat(tmp_path: Path) -> None:
|
||||||
append_images=frames,
|
append_images=frames,
|
||||||
)
|
)
|
||||||
with Image.open(test_file) as im:
|
with Image.open(test_file) as im:
|
||||||
exception = None
|
im.seek(im.n_frames - 1)
|
||||||
try:
|
im.load()
|
||||||
im.seek(im.n_frames - 1)
|
|
||||||
im.load()
|
|
||||||
except Exception as e:
|
|
||||||
exception = e
|
|
||||||
assert exception is None
|
|
||||||
|
|
||||||
|
|
||||||
def test_apng_save_duration_loop(tmp_path: Path) -> None:
|
def test_apng_save_duration_loop(tmp_path: Path) -> None:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user