Skip to content

Commit 01267f9

Browse files
authored
Improve BLP tests (#9020)
2 parents 850271a + ce8083e commit 01267f9

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

Tests/test_file_blp.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
from PIL import BlpImagePlugin, Image
88

99
from .helper import (
10-
assert_image_equal,
1110
assert_image_equal_tofile,
12-
assert_image_similar,
11+
assert_image_similar_tofile,
1312
hopper,
1413
)
1514

@@ -52,18 +51,16 @@ def test_save(tmp_path: Path) -> None:
5251
im = hopper("P")
5352
im.save(f, blp_version=version)
5453

55-
with Image.open(f) as reloaded:
56-
assert_image_equal(im.convert("RGB"), reloaded)
54+
assert_image_equal_tofile(im.convert("RGB"), f)
5755

5856
with Image.open("Tests/images/transparent.png") as im:
5957
f = tmp_path / "temp.blp"
6058
im.convert("P").save(f, blp_version=version)
6159

62-
with Image.open(f) as reloaded:
63-
assert_image_similar(im, reloaded, 8)
60+
assert_image_similar_tofile(im, f, 8)
6461

6562
im = hopper()
66-
with pytest.raises(ValueError):
63+
with pytest.raises(ValueError, match="Unsupported BLP image mode"):
6764
im.save(f)
6865

6966

0 commit comments

Comments
 (0)